Advertisement
weldisalves

Lista 03 - exercício 19

Jun 13th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. //19. Determine o maior valor de uma lista de 100 números fornecidos pelo usuário.
  4.  
  5. int main()
  6. {
  7.     int maior=0,i,valor;
  8.  
  9.     for(i=0;i<100;i++)
  10.     {
  11.         printf("\n Digite um valor: ");
  12.         scanf("%d",&valor);
  13.  
  14.         if(valor > maior) maior=valor;
  15.     }
  16.  
  17.     printf("\n Maior: %d",maior);
  18.  
  19.     getch();
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement