0% found this document useful (0 votes)
21 views2 pages

Grades Calculation

The document is a C program that uses if-else statements to calculate a student's grade based on their marks. The program prompts the user to enter their marks as an integer between 0-100. It then uses a series of if-else statements to check the entered marks and print the corresponding grade, ranging from A to Fail. The program also includes messages like "Congratulation" and "Very Bad" to provide feedback on the grade.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Grades Calculation

The document is a C program that uses if-else statements to calculate a student's grade based on their marks. The program prompts the user to enter their marks as an integer between 0-100. It then uses a series of if-else statements to check the entered marks and print the corresponding grade, ranging from A to Fail. The program also includes messages like "Congratulation" and "Very Bad" to provide feedback on the grade.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Intermediate Part II

Problem: Students Grade Calculation using If - Else Statements

#include<conio.h>
#include <stdio.h>

void main()
{
clrscr();
int m;
printf("Enter Your Marks = ");
scanf("%d",&m);

printf("\n===============================================
===============================\n");

if(m>100)

printf("Please enter the marks between 0-100");


else if(m>=85&&m<=100)
{
printf("\nCongratulation\n");
printf("You have Grade A ");
}
else if(m>=80&&m<85)

printf("\nYou have Grade A- \n");

else if(m>=75&&m<80)

printf("\nYou have Grade B \n");

else if(m>=70&&m<75)

printf("\nYou have Grade B+ \n");

else if(m>=65&&m<70)

printf("\nYou have Grade C \n");

else if(m>=60&&m<65)

printf("\nYou have Grade C+ ");

else if(m>=50&&m<60)

printf("\nYou have Grade D ");


else
{
printf("\nVery Bad \n\n");
printf("You are Fail \n\n");
}

printf("\n===============================================
===============================");

getch();
}

Click the link below to see more examples

http://ravianeducation.blogspot.com
E-Mail: [email protected]

You might also like