Question: Q 1 0 Write a C program that does the following: Accepts a number or - 1 from the user in an infinite loop. Comes

Q10 Write a C program that does the following:
Accepts a number or -1 from the user in an infinite loop.
Comes out of the infinite loop and exits if the user types -1
Calls a function squared() that accepts a number and returns its square.
Prints the result of the function called squared().
Calls a function cubed() that accepts a number and returns its cube.
Prints the result of the function called cubed().
Prints an output as shown below.
Enter a number (-1 to exit): 3
The square of 3 is: }
The cube of 3 is: }2
Enter a number (-1 to exit): 4
The square of 4 is: 16
The cube of 4 is: }6
Enter a number (-1 to exit): 8
The square of 8 is: 64
The cube of 8 is: 512
Enter a number (-1 to exit): -1
Q 1 0 Write a C program that does the following:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!