Advertisement
Fakhru

Untitled

Feb 15th, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int marks[5];
  7. int total = 0;
  8. int avg;
  9. cout << "Enter marks for 5 students :" << endl;
  10. for(int i = 0;i < 5;i++){
  11.     cin >> marks[i];
  12. }
  13.  
  14. for(int i = 0;i < 5;i++){
  15. cout << "Student " << i + 1 << " : " << marks[i] << endl;
  16. total = total + marks[i];
  17.  
  18.  
  19. }
  20. avg = total / 5;
  21. cout << "Total marks for all the students are : " << total << endl;
  22. cout << "Average mark is : " << avg << endl;
  23.  
  24. system("pause");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement