diff --git a/Grade.c b/Grade.c new file mode 100644 index 0000000..a2a95f6 --- /dev/null +++ b/Grade.c @@ -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"); + } +} \ No newline at end of file diff --git a/Grade.exe b/Grade.exe new file mode 100644 index 0000000..e2f984d Binary files /dev/null and b/Grade.exe differ diff --git a/Order Of Programs.md b/Order Of Programs.md index 3a46697..8b9b39d 100644 --- a/Order Of Programs.md +++ b/Order Of Programs.md @@ -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 | \ No newline at end of file +|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). | \ No newline at end of file