21-Write a C program to calculate the division of a student using and operator.

Program: 21

Write a C program to calculate the division of a student using and operator.

#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");
    if((per>=50)&&(per<60))
        printf("Second Division");
    if((per>=40)&&(per<50))
        printf("Third Division");
    if(per<40)
        printf("Fail");
getch();
}
Output
Enter the marks of five subjects: 65 75 83 47 77

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.