Sunday, November 8, 2009

C Program to calculate sum of 3 subjects nd check wheter it is Eligible or Not Eligible

#include
#include
void main()
{
int math,chem,phy,s1,s2;
printf("enter marks in maths,phy,chem");
scanf("%d,%d,%d",&math,&phy,&chem);
s1=math+phy+chem;
s2=math+phy;
if((math>=60)&&(phy>=50)&&(chem>=40))
{
printf("Eligible");
}
else if(s1>=200)
{
printf("Eligible");
}
else if(s2>=150)
{
printf("Eligible");
}
else
{
printf("Not Eligible");
}
getch();
}

No comments: