Advertisement
fellpz

Media C++

Mar 16th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int main ()
  8. {
  9.     int i, alunos;
  10.     float notas, somanota;
  11.  
  12.     cout<<"Informe a quantidade de alunos: ";
  13.     cin>>alunos;
  14.  
  15.     somanota = 0;
  16.     i = 0;
  17.  
  18.     while (  i < alunos )
  19.     {
  20.         cout<<"Informe as notas: ";
  21.         cin>>notas;
  22.         somanota = somanota + notas;
  23.         i++;
  24.     }
  25.  
  26.     cout<< "A quantidade de alunos eh: "<<alunos<<endl;
  27.     cout<< "As notas foram: "<<notas<<endl;
  28.     cout<< "A media da turma eh: "<<somanota/alunos<<endl;
  29.  
  30.     system("PAUSE");
  31.     return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement