Advertisement
Guest User

calcular exponencial até 10

a guest
Aug 19th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main()
  4. {
  5.     int q;
  6.     int o=1;
  7.     int i=0;
  8.     int p;
  9.     int r;
  10.     printf("Qual o valor da base?");
  11.     scanf("%d",&p);
  12.     printf("Até qual potência você deseja calcular?");scanf("%d",&q);
  13.  
  14.  
  15.     while (i<q)
  16.     {
  17.         r = pow(p,o);
  18.         printf("%d\n",r);
  19.         i++;
  20.         o++;
  21.     }
  22.    
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement