Rita is writing a C++/programe in whic, she wants to display thr grades ( stored in variable grade) as per the table of marks (stored in variable marks) given below:
A - 90-100
B - 80-89
C - 70-79
D < 70
Write the code using appropriate C++ conditional statement so as to help Rita complete her work after accepting marks.
Answers
Answered by
2
#include<iostream>
using namespace std;
int main(){
int marks;
cout<<"please enter your marks ";
cin>>marks;
if(marks>=90&&marks<=100)
cout<<"A";
else if(marks>=80&&marks<=89)
cout<<"B";
else if(marks>=70&&marks<=79)
cout<<"C"
else
cout<<"D";
return 0;
}
You can modify the print statements as you want them to be.
using namespace std;
int main(){
int marks;
cout<<"please enter your marks ";
cin>>marks;
if(marks>=90&&marks<=100)
cout<<"A";
else if(marks>=80&&marks<=89)
cout<<"B";
else if(marks>=70&&marks<=79)
cout<<"C"
else
cout<<"D";
return 0;
}
You can modify the print statements as you want them to be.
runiyal246:
Arey meko kuch ni aata bhyii..
Similar questions