Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: promedio.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- double calif1, calif2, calif3, calif4, calif5, suma=0.0, promedio;
- cout << "Promedio de Cinco Notas" << endl;
- cout << "=======================" << endl;
- cout << "Entre nota1 [0.0..5.0]= "; cin >> calif1;
- cout << "Entre nota2 [0.0..5.0]= "; cin >> calif2;
- cout << "Entre nota3 [0.0..5.0]= "; cin >> calif3;
- cout << "Entre nota4 [0.0..5.0]= "; cin >> calif4;
- cout << "Entre nota5 [0.0..5.0]= "; cin >> calif5;
- suma = calif1+calif2+calif3+calif4+calif5;
- promedio = suma / 5.0;
- cout.setf(ios::fixed);
- cout << setprecision(2) << endl;
- cout << "Promedio= " << promedio << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement