Advertisement
hamaXD

basic function POW !!!NOT complete

Oct 20th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. double getA(int x,int y);
  4. main()
  5. {
  6.     int a,b;
  7.     int x;
  8.     scanf("%d",&a);
  9.     scanf("%d",&b);
  10.     x = getA(a,b);
  11.     printf("result main = %d\n",x);
  12.     return 0;
  13. }
  14. double getA(int x,int y)
  15. {
  16.     int i;
  17.     int result=x;
  18.     for(i=1;i<y;i++){
  19.         result=result*x;
  20.         //x*=x;
  21.     }
  22.     printf("result = %d\n",x);
  23.     return result;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement