hamaXD

basic function POW

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