/*WAP to enter five subject marks of student & calculat total marks,percentege,average,division*/
#include<stdio.h>
#include<conio.h>
void main()
{
int os,sm,dm,ppl,dsa,total;
float per,avg;
clrscr();
printf("enter five subjects marks");
scanf("%d%d%d%d%d",&os,&sm,&dm,&ppl,&dsa);
total=os+sm+dm+ppl+dsa;
per=total*100/50;
avg=total/5;
printf("\ntotal=%d",total);
printf("\npercentege=%f\navrege=%f",per,avg);
if(per>=60)
{
printf("\ndiv=first div.");
}
else
if(per>=45 &&per<60)
{
printf("\ndiv=second div");
}
else
if(per>=33 &&per<45)
{
printf("\ndiv=third div");
}
else
{
printf("\ndiv=fail");
}
getch();
}
No comments:
Post a Comment