ramontricolor12

LISTA 03 - Exercício 19

Jun 28th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. /* CABEÇALHO
  2.    Arquivo: LISTA 03 - Exercicio 19.c
  3.    Objetivo: Informe o maior valor de uma lista de numeros.
  4.    Autor(a): Ramon Borges
  5.  */
  6.  
  7.  #include <stdio.h>
  8.  #define quantNum 10
  9.  int main()
  10.  {
  11.      int i, numero, maior;
  12.  
  13.      for(i = 1; i <= quantNum; i++)
  14.      {
  15.          printf("\nInforme o algarismo: ");
  16.          scanf("%d", &numero);
  17.  
  18.          if(i == 1)
  19.             maior = numero;
  20.          else
  21.             if(numero > maior)
  22.                 maior = numero;
  23.      }
  24.      printf("\nO MAIOR NUMERO E %d\n", maior);
  25.      return 0;
  26.  }
Advertisement
Add Comment
Please, Sign In to add comment