C program for Grading System

Write a C program for Grading System to Calculate the Grade of a Student:


Required Knowledge:

C Basics, If-else

 1 #include<stdio.h>
 2  void main()
 3  {
 4      int marks;
 5  
 6      printf("Enter student marks:");
 7  
 8      scanf("%d",&marks);
 9  
10      if(marks>=80)    
11  
12          printf("Grade of student is A");
13  
14      else if((marks<=79)&&(marks>=70))
15  
16          printf("Grade of student is B");
17  
18      else if((marks<=69)&&(marks>=60))
19  
20          printf("Grade of student is C");
21  
22      else if((marks<=59)&&(marks>=50))
23  
24          printf("Grade of student is D");
25  
26      else
27  
28          printf("Grade of student is F");
29  }

Output:



Enjoy It......

Comments

Popular posts from this blog

C program to calculate velocity

C program to find square root of a number

C program to find maximum between two numbers