Monday, May 1, 2023

Find the power of a number where the base and power is imputed from keyboard .

 //find the power of a number where the base and power is imputed from keyboard 

#include "stdio.h"

#include "math.h"

int main ()

{

int base,expo,result;

printf ("Enter the base and power :\n");

scanf ("%i%i",&base,&expo);

result=pow(base,expo);

printf ("%i to the  power %i is %i",base,expo,result);

return 0;

}

              output                          output                          output            

 Enter the base and power :

2

4

2 to the  power 4 is 16

No comments:

Post a Comment

print a multiplication table of any integer taking from user

 // print a multiplication table of any integer taking from user  #include "stdio.h" int main () { int n,mul,i; printf ("...