Question: (a) Write an int function called power (int n, int r) to calculate n to the power of ri.e. n. For example, if n
(a) Write an int function called power (int n, int r) to calculate n to the power of ri.e. n. For example, if n = 3 and r=4, it should return 3* = 81. (b) Write the main program and by calling the function you wrote in (a) display the first 10 powers of 2 until 4 in different lines, i.e. 48 3 9 27 234 185 616 16 81 16 64 256 32 243 1024 64 729 4096 128 2187 16384 256 512 6561 19683 65536 262144 1024 59049 1048576
Step by Step Solution
There are 3 Steps involved in it
Certainly Heres a C program that includes the requested power function and displays ... View full answer
Get step-by-step solutions from verified subject matter experts
