Question: 1) write a C program with the following requirements: In the main() function, please define 2 local variables a and b, and ask the users

1) write a C program with the following requirements: In the main() function, please define 2 local variables a and b, and ask the users to enter the initial values for them. Afterwards, print out the values of a and b, as well as the result for pow(a, b). Define a function func(), which doubles the values that a and b pointed to. Then call function func() by passing values by reference in the main() function. Afterwards, print out the values of a and b, as well as the result for pow(a, b) again. Note: please figure out how to call a function using a pass by reference parameter.

2) Please write a C program with the following requirements: Define a static global variable count with an initial value 10. Define a function func() for squaring the value of count; specifically, the parameter for func() is count, and the return value of func() is void. Call function func() twice in main(), and print out the value of count after each calling. Note: in C programming, when static is used on a global variable, it causes only one copy of that member to be shared by all the objects of its class.

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 Databases Questions!