Computer Science, asked by hadiqahsheikh4, 3 months ago

Write a program which will ask the user to enter his/her marks (out of 100). Define a
function that will display grades according to the marks entered as below:
Marks Grade
91-100 A+
81-90 A
71-80 B+
61-70 B
51-60 C

41-50 D
below 40 Fail

Answers

Answered by Anonymous
8

Answer:

91-100 A+ ...................

Answered by dreamrob
1

Program :

#include<iostream>

using namespace std;

void Print_Grade(int grade)

{

if(grade >= 91 && grade <= 100)

{

 cout<<"A+";

}

else if(grade >= 81 && grade <=90)

{

 cout<<"A";

}

else if(grade >= 71 && grade <= 80)

{

 cout<<"B+";

}

else if(grade >= 61 && grade <= 70)

{

 cout<<"B";

}

else if(grade >= 51 && grade <= 60)

{

 cout<<"C";

}

else if(grade >= 41 && grade <= 50)

{

 cout<<"D";

}

else  

{

 cout<<"Fail";

}

}

int main()

{

int grade;

cout<<"Enter grade out of 100 : ";

cin>>grade;

Print_Grade(grade);

return 0;

}

Similar questions