Sunteți pe pagina 1din 1

Solution to Question No.

4 :
Program:
/*Program for displaying whether an university student has passed,failed
or has to reappear in ancillary subject exam*/
#include<stdio.h>
void main()
{
float A,B;
clrscr();
printf("Enter the marks obtained in main subject A:");
scanf("%f",&A);
printf("Enter the marks obtained in ancillary subject B:");
scanf("%f",&B);
if (A<45)
printf("The student has failed");
else
{ if (A<55)
{ if (B>=27.5)
printf("The student has passed");
else
printf("The student has failed");
}
else
{ if (A>=65)
{ if (B>=22.5)
printf("The student has passed");
else
printf("The student is allowed to reapper in ancillary subject B
to qualify");
}
else
{ if (B<22.5)
printf("The student has failed");
else
printf("The student has passed");
}
}
}
getch();
}

S-ar putea să vă placă și