Answer to Question #200456 in C++ for Adib

Question #200456

Suppose there are three students in a class and their marks have been uploaded to the

software system, these students have applied for scholarship through online software system. The system should compare marks of these three students and should award scholarship to

the one with high marks.


1
Expert's answer
2021-05-30T07:24:22-0400
#include <iostream>


using namespace std;


int main()
{
    
    cout<<"Enter marks for the three students: "<<endl;
    int marks1,marks2,marks3;
    cout<<"\nEnter marks for student 1: ";
    cin>>marks1;
    cout<<"\nEnter marks for student 2: ";
    cin>>marks2;
    cout<<"\nEnter marks for student 3: ";
    cin>>marks1;
    int largest;
    if ((marks1 >= marks2) && (marks1 >=marks3 ))
        largest = marks1;
  
    else if ((marks2 >= marks1) && (marks2 >= marks3))
        largest = marks2;
    else
        largest = marks3;
    cout<<"\nStudent with "<<largest<<" has won the scholarship";
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog