This commit is contained in:
2021-04-27 10:39:54 +05:30
parent 3d26196d7b
commit a4a5c63e1f
3 changed files with 58 additions and 1 deletions

56
Grade.c Normal file
View File

@@ -0,0 +1,56 @@
// Use else if ladder statements to find out the result grade from the percentage.
/* AA 100-90
AB 89-75
BB 74-60
CC 59-35
FF <=34
*/
void main() {
int s1,s2,s3,s4,s5,t,p;
printf("\n Enter marks of 5 subjects each out of 100 ");
printf("\n\n ********************************************");
printf("\n\n Maths = ");
scanf("%d",&s1);
printf("\n Science = ");
scanf("%d",&s2);
printf("\n English = ");
scanf("%d",&s3);
printf("\n History = ");
scanf("%d",&s4);
printf("\n Geography = ");
scanf("%d",&s5);
printf("\n ********************************************");
t=s1+s2+s3+s4+s5;
printf("\n Total marks = %d/500",t);
p=t/5;
printf("\n\n Percentage = %d ",p);
printf("\n ********************************************");
if(p>=90) {
printf("\n\n Your Grade : AA");
}
else if(p>=75) {
printf("\n\n Your Grade : AB");
}
else if(p>=60) {
printf("\n\n Your Grade : BB");
}
else if(p>=34) {
printf("\n\n Your Grade : CC");
}
else {
printf("\n\n Your Grade : FF");
}
}

BIN
Grade.exe Normal file

Binary file not shown.

View File

@@ -16,4 +16,5 @@
|14 | AgeCheck.c | AgeCheck.exe | WAP to check your age > 18 or not (using if else statement) |
|15 | MaximumNo2.c | MaximumNo2.exe | WAP to find out maximum out of two numbers |
|16 | MaximumNo4.c | MaximumNo4.exe | WAP to find out maximum out of three numbers using nested if..else |
|17 | PositiveOrNegative.c | PositiveOrNegative.exe | WAP to find out a given number is positive, negative or 0 |
|17 | PositiveOrNegative.c | PositiveOrNegative.exe | WAP to find out a given number is positive, negative or 0 |
|18 | Grade.c | Grade.exe | Use else if ladder statements to find out the result grade from the percentage (Mentioned in file of the program). |