Code Scrappers


Grades Calculation - C program


                    #include<stdio.h>
                    #include<stdlib.h>

                    void main()
                    {
                        int marks;

                        printf("Enter the student marks");

                        scanf("%d",&marks);

                        if(marks > 90 && marks <= 100)

                        printf("O grade");

                        else if(marks > 80 && marks <= 90)

                        printf("A grade");

                        else if(marks > 70 && marks <= 80)

                        printf("B grade");

                        else if(marks > 60 && marks <= 70)

                        printf("C grade");

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

                        printf("D grade");

                        else if(marks < 50)

                        printf("E grade");

                    }
                



Output

            Enter the student marks : 85
            A grade