Guest User

Untitled

a guest
Jul 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.   int cont, a, maior1, maior2;
  7.   cont=1;  
  8.   maior1=a;
  9.   maior2=a;
  10.  
  11.   while (cont<=10) {
  12.         printf("Digite o numero %d:", cont);
  13.         scanf("%d", &a);
  14.         cont++;
  15.         if(a>maior1) {
  16.         maior1=a;
  17. }
  18. if (maior2>maior1) {
  19.    maior1=maior2;
  20. }
  21.  
  22. }  
  23.  
  24.  printf("O primeiro maior e: %d e o segundo maior e: %d\n", maior1, maior2);
  25.   system("PAUSE"); 
  26.   return 0;
  27. }
Add Comment
Please, Sign In to add comment