Advertisement
Tahamina_Taha

Power of a number

Jul 20th, 2019
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. //Power function
  2. #include<stdio.h>
  3. #include<math.h>
  4. int main(){
  5. double base,expo,power;
  6.     printf("Enter base:\n");
  7.     scanf("%lf",&base);
  8.     printf("Enter exponent:\n");
  9.     scanf("%lf",&expo);
  10.     power=pow(base,expo);
  11.     printf("%.2lf^%.2lf=%.2f",base,expo,power);
  12.     return 0;
  13.  
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement