Computer Science, asked by Ranajoy64821, 10 months ago

Write a program that reads marks in three subjects and assign grades on the basis of percentage of marks brainly

Answers

Answered by dreamrob
4

Program in C++

#include<iostream>

using namespace std;

int main()

{

double M1, M2, M3, Per;

cout<<"Enter marks in three subjects (out of 100): "<<endl;

cin>>M1;

cin>>M2;

cin>>M3;

Per = ((M1 + M2 + M3) / 300) * 100;

cout<<"Percentage = "<<Per<<"%"<<endl;

if(Per > 75)

{

 cout<<"A";

}

else if(Per > 60 && Per <= 75)

{

 cout<<"B";

}

else if(Per > 50 && Per <= 60)

{

 cout<<"C";

}

else if(Per >= 40 && Per <= 50)

{

 cout<<"D";

}

else

{

 cout<<"FAIL";

}

return 0;

}

Similar questions