20-Write a C program to calculate the division of a student.

Program: 20

Write a C program to calculate the division of a student.

#include
#include
void main()
{
    int ma, en, ph, ch, cs, sum, per;
    printf("Enter the marks of five subjects: ");
    scanf("%d %d %d %d %d", &ma, &en, &ph, &ch, &cs);
    sum=ma+en+ph+ch+cs;
    per=sum/5;
    if(per>=60)
    {
        printf("You got first division.");
    }
    else
    {
        if(per>=50)
        {
            printf("You got second division.");
        }
        else
        {
            if(per>=40)
            {
                printf("You got third division.");
            }
            else
                printf("fail");
        }
    }
getch();
}
Output
Enter the marks of five subjects: 34 67 78 98 69

You got first division.

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.