GJPassos

VETORES 01

May 20th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1.  //GILMAR JUNIOR DOS PASSOS - PROF MALGARETE
  2.  //ALGORITMOS 02 CENTRO TECNOLOGICO UNIVERSIDADE POSITIVO
  3.  
  4.  #include <stdio.h>
  5.  #include <stdlib.h>
  6.  #include <math.h>
  7.  #include <iostream>
  8.  #include <conio.h>
  9.  
  10. //Faça um programa para ler uma sequencia de 8 notas e mostrar quais as notas maiores que a média dessas notas.
  11.  
  12. int main (void)
  13.  {
  14.  float notas[8], maior, media;
  15.  int cont;
  16.  
  17.  printf("Entre com a nota\n");
  18.  scanf("%f",&notas[1]);
  19.  maior = notas[1];
  20.  media = notas[1];
  21.  
  22.  for (cont=2;cont<=8;cont++)
  23.  {
  24.  printf("Entre com a nota\n");
  25.  scanf("%f",&notas[cont]);
  26.  
  27.  if(maior<=notas[cont])
  28.  {
  29.  maior = notas[cont];
  30. }
  31. media = media + notas[cont];
  32.  
  33. }
  34. media = media / 8 ;
  35. printf("a maior nota da sala e:%.2f",maior);
  36. printf("\n");
  37. printf("a media de notas e:%.2f",media);
  38. printf("\n");
  39. getch();
  40. }
Advertisement
Add Comment
Please, Sign In to add comment