Advertisement
machkovskitomche

y=x^n

Aug 7th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<math.h>
  4.  
  5. int main()
  6. {
  7.     float x,y;
  8.     int n,brojach;
  9.     printf("Vnesi ja osnovata:\t");
  10.     scanf("%f",&x);
  11.     printf("Vnesete go eksponentot:\t");
  12.     scanf("%d",&n);
  13.     y=1.0;
  14.     brojach=1;
  15.     while(brojach<=n)
  16.     {
  17.         y=y*x;
  18.         brojach++;
  19.     }
  20.     printf("%f^%d=%f",x,n,y);
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement