Advertisement
FoxTuGa

Elev Num- <Old>

May 8th, 2011
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. long long int n1, n2, nt, x, p, r;
  5.  
  6. // Principal.
  7. int main()
  8. {
  9.    
  10.     /*Loop infinito para o utilizador fazer multiplas contas*/
  11.     while(1)
  12.     {
  13.     printf("\n\t  Introduza dois numeros: ");
  14.     fflush(stdin);                  //Passar todas as letras a 0.
  15.     scanf("%lld %lld", &n1, &n2);           //Inputs dos valores
  16.     system("cls");                  //Limpar o ecran Apรณs os dados serem introduzidos
  17.  
  18.         /*Loop que efectua as contas*/
  19.         nt=n1; x=n2;
  20.         while(x>1)
  21.         {
  22.             nt*=n1;
  23.             x--;
  24.         }
  25.  
  26.     printf("\n %lld^%lld = %lld", n1, n2, nt);  // Output dos valores
  27.     }
  28.  
  29.         return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement