Advertisement
KDOXG

Exercicio

Jan 7th, 2020
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define N 5
  4.  
  5. int main()
  6. {
  7.     float notas;
  8.     int i, maior = 0, v = 0;
  9.     for (int i = 0; i < N; i++)
  10.     {
  11.         printf("Digite nota aqui: ");
  12.         scanf("%f",&notas);
  13.         if (notas > maior)
  14.         {
  15.             maior = notas;
  16.             v = 0;
  17.         }
  18.         if (notas == maior)
  19.         {
  20.             v++;
  21.         }
  22.     }
  23.  
  24.     printf("A nota maior foi %f que apareceu %d vezes\n",maior,v);
  25.     system("pause");
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement