Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int marks[5];
- int total = 0;
- int avg;
- cout << "Enter marks for 5 students :" << endl;
- for(int i = 0;i < 5;i++){
- cin >> marks[i];
- }
- for(int i = 0;i < 5;i++){
- cout << "Student " << i + 1 << " : " << marks[i] << endl;
- total = total + marks[i];
- }
- avg = total / 5;
- cout << "Total marks for all the students are : " << total << endl;
- cout << "Average mark is : " << avg << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement