0% found this document useful (0 votes)
18 views1 page

C Program for Student Grade Calculation

The document outlines a C program that takes a student's marks as input and assigns a grade based on specified criteria. Grades are assigned as follows: A for 90 and above, B for 75 to 89, C for 60 to 74, D for 50 to 59, and F for below 50. The program includes input validation to ensure marks are within the range of 0 to 100.

Uploaded by

emily16852.9a
Copyright
© All Rights Reserved
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)
18 views1 page

C Program for Student Grade Calculation

The document outlines a C program that takes a student's marks as input and assigns a grade based on specified criteria. Grades are assigned as follows: A for 90 and above, B for 75 to 89, C for 60 to 74, D for 50 to 59, and F for below 50. The program includes input validation to ensure marks are within the range of 0 to 100.

Uploaded by

emily16852.9a
Copyright
© All Rights Reserved
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

Aim

Develop a C program that takes a student's marks as input and displays their grade
based on the following criteria: 90 and above: Grade A 75 to 89: Grade B 60 to 74:
Grade C 50 to 59: Grade D Below 50: Grade F Choose a suitable control structure
to impleme nt this logic efficiently.

Code

#include<stdio.h>

int main()

int marks;

printf("Enter the student's marks:");

scanf("%d",&marks);

if(marks>100)

printf("Enter the correct marks between 0 and 100 \n");

else if(marks>=90)

printf("Grade A \n");

else if(marks >=75)

printf("Grade B \n");

else if(marks >=60)

printf("Grade C \n");

else if(marks >=50)

printf("Grade D \n");

else if(marks>=0)

printf("Grade F \n");

else

printf("Enter the correct marks between 0 and 100 \n");

return 0;

You might also like