Tuesday, 28 October 2014

Enter marks in 5 subjects and print the divison



Enter marks in 5 subjects and print the divison





/*WAP to enter marks in 5 subjects and print the divison*/

#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2,n3,n4,n5;
float total,avg;
clrscr();
printf("enter 5 marks:");
scanf("%d%d%d%d%d",&n1,&n2,&n3,&n4,&n5);
total=n1+n2+n3+n4+n5;
avg=total/5;
if(avg>=60)
printf("FIRST CLASS");
else if(avg>=50)
printf("SECOND CLASS");
else if(avg>=30)
printf("THIRD CLASS");
else
printf("FAIL");
getch();
}

OUTPUT:
enter 5 marks:88 77 66 56 78

FIRST CLASS

No comments:

Post a Comment