Tuesday, March 5, 2024

4. Grade calculation :—


#include<stdio.h>

int main()

{

    int n;

    printf("enter value of 'n' ");

    scanf("%d",&n);

    if(n>=80)

    {

        printf("Greade A");

    }    

    else

    {

        if(n>=60)

        {

            printf("Grade B");

        }

        else

        {

            if(n>=40)

            {

                printf("Grade C");

            }

            else

            {

                printf("F");

            }

        }

    }

    return 0;

}


No comments:

Post a Comment