Guest User

Untitled

a guest
Oct 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. main(){
  5.  
  6. int x = 0;
  7. int y = 0;
  8.  
  9. star:
  10.  
  11. printf("Digite x: ");
  12. scanf("%d", &x);
  13. printf("Digite a potência que será elevada: ");
  14. scanf("%d", &y);
  15.  
  16. int aux = 1;
  17.  
  18. for(int i = 0; i < y; i++) {
  19. aux *= x;
  20. }
  21.  
  22. printf("\n\nResultado = %d\n\n", aux);
  23. goto star;
  24. }
Add Comment
Please, Sign In to add comment