fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int a,b,c,i=1;
  6. scanf("%d",&a);
  7. scanf("%d",&b);
  8. c=a;
  9. while(i<b)
  10. {
  11. c=c*a;
  12. i++;
  13. }
  14. printf("The value of %d to the power of %d is %d.\n", a, b, c);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5356KB
stdin
5 3
stdout
The value of 5 to the power of 3 is 125.