CPE 325-Laboratory Assignment #1 Solved

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

5/5 - (1 vote)

 

 

Assignment

  1. Write a program in C where you would perform the following tasks:
    1. Declare a integer variable a whose value is 15, and another integer p whose value is 5.
    2. Make a call to function myPower() whose arguments are the integer value a and power value p. This function should return an integer value which you will assign to another integer value b which should be equal to a raised to p.
      1. You need to write your own function myPower()
      2. Ask your instructor how to write a function in C. iii. Do not use standard C function that calculates power. Instead write your own for loop that calculates power.
      3. Print a statement that looks similar to the following replacing a, p and b with their respective values.

a raised to the power p is b

  1. Write a C program to count the number of symbols that represent mathematical operations in a string. Mathematical operations include %, &, *, +, -, /, <, >, =, ^ and ~. You can define the string in your program as a character array. For demonstration purpose, your output should exactly look like following.

String: Do 42+53/76%8=2*8-32+71 & you can sleep. Contains: The string contains 8 symbols that represent mathematical operations.

 

  • Lab1-2tahuu.zip