To find the grades of student by nested if,else loops
To find the grades of
student by nested if,else loops:-
#include<stdio.h>
#include<conio.h>
void main()
{
int marks;
clrscr();
printf("enter your marks out of 100 = ");
scanf("%d",&marks);
if(marks>80)
{
printf("your grade is A");
}
else
{
if(marks>50)
printf("your grade is B");
else
{
printf("your grade is C");
}
}
getch();
}
Output:-
Comments
Post a Comment