C CODE:
#include<stdio.h>
main()
{
// Variable declaration//
int marks;
/*Input*/
printf("enter your marks:");
scanf("%d",&marks);
/* actual Working */
if(marks>=90 && marks<=100)
{
printf("grade is A");
}
else if(marks>=80 && marks<=89)
{
printf("grade is B");
}
else if(marks>=70 && marks<=79)
{
printf("grade is C");
}
else if(marks>=60 && marks<=69)
{
printf("grade is D");
}
else if(marks<60)
{
printf("grade is F");
}
else
{
printf("invalid");
}
return 0;
}
No comments:
Post a Comment