Saturday, 12 December 2015

Write a progtam that inputs marks from 0-100 and tells the grade of student with if statement in c++

#include<iostream>
using namespace std;
main()
{ int marks;
cout<<"Enter Marks to know grades"<<endl;
cin>>marks;
if(marks>=80)
cout<<"You have passed with A grade"<<endl;
else if(marks>=70)
cout<<"You have passed with B grade"<<endl;
else if(marks>=60)
cout<<"You have passed with C grade"<<endl;
else if(marks>=50)
cout<<"You have passed with D grade"<<endl;
else if(marks>=40)
cout<<"You have passed with E grade"<<endl;
else
cout<<"You have failed"<<endl;
system("pause");
}

No comments:

Post a Comment