Rita is writing a c++ program in which she want to display the grades (stored in variable grade) as per the table of marks (store 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 how work after accepting marks.
Answers
Answered by
5
// program to accept and display marks. #include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int marks;
cout<<" enter marks";
cin>>marks;
if((marks<=100)&&(marks>=90))
{
cout<<"A";
}
if((marks==89)&&(marks>=80))
{
cout<<"B";
}
if((marks==79)&&(marks=70))
{
cout<<"C";
}
if(marks>70)
{
cout<<"D";
}
getch();
}
this is a simple if program
#include<conio.h>
void main()
{
clrscr();
int marks;
cout<<" enter marks";
cin>>marks;
if((marks<=100)&&(marks>=90))
{
cout<<"A";
}
if((marks==89)&&(marks>=80))
{
cout<<"B";
}
if((marks==79)&&(marks=70))
{
cout<<"C";
}
if(marks>70)
{
cout<<"D";
}
getch();
}
this is a simple if program
bookworm13:
hope u understood
Similar questions