Solution:
#include <stdio.h>
int main() {
int b;
char a[20];
printf("What is your name?\n");
gets(a);
printf("What is your mark?\n");
scanf("%d",&b);
if(b>=80 && b<=100){
printf("Outstanding! You've got A+.\n");
}
else if(b<=79 && b>=75){
printf("Excellent! You've got A.\n");
}
else if(b<=74 && b>=70){
printf("Very Good! You've got A-\n.");
}
else if(b<=69 && b>=65){
printf("Good! You've got B+.\n");
}
else if(b<=64 && b>=60){
printf("You've got B.Try to do better.\n");
}
else if(b<=59 && b>=55){
printf("You've got B-.Try to do better.\n");
}
else if(b<=54 && b>=50){
printf("You've got C+. Try to do better.\n");
}
else if(b<=49 && b>=45){
printf("You've got C. Try to do better.\n");
}
else if(b<=44 && b>=40){
printf("You've got D. Try to do better.\n");
}
else if(b<=39 && b>=0){
printf("Sorry! You've failed. But don't loose hope. Try again.\n");
}
else printf("Invalid mark! Please enter a valid mark.\n");
return 0;
}
Post a Comment