Advertisement
FoxTuGa

Mul Op Wo X - <Old>

May 8th, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int n1, n2, nt, x, p1;
  5.  
  6. int main()
  7. {
  8.     //Loop infinito que permite introduzir os dados mais que uma vez
  9.     while(1)
  10.     {
  11.     printf("\n\n\t Introduza dois numeros: ");
  12.     fflush(stdin);                              //Validação de caracteres
  13.     scanf("%d %d", &n1, &n2);                   //Input de dados
  14.     system("cls");      //Limpar o ecran Após os dados serem introduzidos
  15.  
  16.         //Loop Aritmético
  17.         x=n2; nt=n1;
  18.         while(x>1)
  19.         {
  20.             nt += n1 ;
  21.             x--;
  22.         }
  23.  
  24.     printf("\n %d x %d = %d", n1, n2, nt);      //Output de dados
  25.     }
  26.  
  27.  
  28.     printf("\n\n");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement