saving . . . saved assignment has been deleted. assignment has been hidden .
assignment
Title
Question
<span style="color: rgb(85, 85, 85); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px;">Write a program that takes the marks of three students as input. Compare the marks to see which student has scored the highest. Check also if two or more students have scored equal marks.</span>

C-and-Cpp Relational-Operators 08-09 min 40-50 sec 05-04-24, 10:57 a.m. Aayush_Dhiman

Answers:

Dear user,

Hint:
Take 3 variables and compare them. (> and >=or <, <=)
 
The assignment is for solving, Please go through the tutorial for similar example.
05-04-24, 5:24 p.m. madhurig


#include<iostream>
Using namespace std;
int main ()
{
 int m1,m2,m3;
 cout<<"Enter Marks of student";
 cin>>m1>>m2>>m3;
 int count=0;
 int max=m1;
 if(max<m2 )
 {
   max=m2;
 }
 if(max<m3)
 {
   max=m3;
 } 
 If(m1==m2 && m2==m3)
  count=3;
}
else if (m1==m2 || m2==m3 || m1==m3)
 {
 count=2;
 }
 cout<<"highest score is"<<max<<endl;
if (count>0)
{
 cout<<count<<"student scored equal marks"<<endl;
}
 else
{
 cout<<"All student scored different marks";
}
 return 0;
}
29-04-24, 1:56 a.m. mitanshi390@gmail.com


Log-in to answer to this question.