Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- // Do-while
- // Autor: Alexandre Campos
- int main()
- {
- // Declaracao
- int a, b, opcao;
- double resultado;
- // Repeticao
- do {
- printf("Digite o numero a\n");
- scanf("%d", &a);
- printf("Digite o numero b\n");
- scanf("%d", &b);
- // Calculo a^b
- resultado = pow(a, b);
- printf("%d^%d = %lf\n", a, b, resultado);
- printf("Digite:\n");
- printf("*1: Continuar\n");
- printf("*2: Parar\n");
- scanf("%d", &opcao);
- } while (opcao == 1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment