move to repo.or.cz
[letusc.git] / ch2 / examples / example5.c
blob14fbeb0568f050142fa91c41c8f2cc1646f6c3e0
1 #include<stdio.h>
3 int main()
5 int s1,s2,s3,s4,s5;
6 float per;
7 printf("Enter the marks of all 5 subjects: ");
8 scanf("%d %d %d %d %d",&s1,&s2,&s3,&s4,&s5);
10 per = (s1+s2+s3+s4+s5)/5;
11 if(per>=60)
13 printf("First Division\n");
15 else if(per>=50 && per<=59)
17 printf("Second Division\n");
19 else if(per>=40 && per<=49)
21 printf("Third Division\n");
23 else if(per<40)
25 printf("Fail\n");
29 return 0;