Advertisement
Mastercpp

promedio de vectores

Aug 11th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. include <iostream>
  2. #include <stdlib.h>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8.     int notas[5];
  9.     float promedio=0;
  10.  
  11.     for(int i =0; i<5; i++){
  12.         cout << "ingrese  una nota para " << i+1 << " : ";
  13.         cin>>notas[i];
  14.         promedio +=notas[i];
  15.     }
  16.  
  17.     promedio /=5;
  18.  
  19.     cout << "El promedio de las notas es : " << promedio << endl;
  20.  
  21.  
  22.     system("pause");
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement