Marks Obtained In 3 Subjects
/* PROGRAM TO ACCEPT MARKS OBTAINED IN 3 SUBJECTS AND THEN DISPLAY WHETHER THE STUDENT IS PASSED OR NOT BASED ON THE FOLLOWING CONDITIONS PASSING CRITERIA.... (S1+S2) >= 120 (S2+S3) >= 120 (S1+S3) >= 120 (S1+S2+S3) >= 150 */ #include
#include
void main() { int s1,s2,s3; clrscr(); printf("\nEnter the marks obtained in 3 subjects\n\n"); scanf("%d%d%d",&s1,&s2,&s3); if((s1+s2+s3)>=150) printf("\npassed"); else if((s1+s2)>=120) printf("\npassed"); else if((s2+s3)>=120) printf("\npassed"); else if((s1+s3)>=120) printf("\npassed"); else printf("\nfailed"); getch(); }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/