22-Write a C program to calculate the division of a student using else-if.

Program: 22

Write a C program to calculate the division of a student using else-if.

#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("First Division");
    else if(per>=50)
        printf("Second Division");
    else if (per>=40)
        printf("Third Division");
    else
        printf("Fail");
getch();
}
Output
Enter the marks of five subjects: 67 43 23 57 84

Second 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.