amlxv

joe

Nov 8th, 2019 (edited)
201
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. using namespace std;
  3.  
  4. int main() {
  5.  
  6.     int mark, num = 1, student = 1;
  7.     int moreThanFive = 0;
  8.  
  9.     while (student <= 30) {
  10.  
  11.         cout << "Enter " << num << " student mark : " ;
  12.         cin >> mark;
  13.         num++;
  14.         student++;
  15.  
  16.         if (mark >= 5) {
  17.  
  18.             moreThanFive = moreThanFive + 1;
  19.  
  20.         }
  21.     }
  22.  
  23.     cout << "\nThe total of student that have mark greater than 5 is " << moreThanFive << endl;
  24.  
  25. }
Add Comment
Please, Sign In to add comment