Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- main(){
- int x = 0;
- int y = 0;
- star:
- printf("Digite x: ");
- scanf("%d", &x);
- printf("Digite a potência que será elevada: ");
- scanf("%d", &y);
- int aux = 1;
- for(int i = 0; i < y; i++) {
- aux *= x;
- }
- printf("\n\nResultado = %d\n\n", aux);
- goto star;
- }
Add Comment
Please, Sign In to add comment