Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int getMax = 0;
- int getMin = 99999;
- int i = 1;
- int mark;
- int num = 1;
- int iMax;
- int iMin;
- for(i=1; i<=5; i++){
- cout << "Enter the student " << num << " mark : " ;
- cin >> mark;
- num++;
- if(mark > getMax){
- getMax = mark;
- iMax = i;
- }
- if(mark < getMin){
- getMin = mark;
- iMin = i;
- }
- }
- cout << "\nThe lowest of quiz mark is " << getMin << " which is from student " << iMin << endl;
- cout << "The highest of quiz mark is " << getMax << " which is from student " << iMax << endl;
- }
Add Comment
Please, Sign In to add comment