[Solved] CPE 325-Laboratory Assignment #1

$25

File Name: CPE_325-Laboratory_Assignment_#1.zip
File Size: 301.44 KB

SKU: [Solved] CPE 325-Laboratory Assignment #1 Category: Tag:
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.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CPE 325-Laboratory Assignment #1
$25