0% found this document useful (0 votes)
24 views1 page

Solution To Question No.4: Program

The program takes input of marks obtained in main subject A and ancillary subject B from the user. It then checks the conditions for passing, failing, or being allowed to reappear based on the marks obtained. If marks in A are less than 45, the student fails. Otherwise, it checks further conditions on A and B marks to determine the result.

Uploaded by

pontas97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Solution To Question No.4: Program

The program takes input of marks obtained in main subject A and ancillary subject B from the user. It then checks the conditions for passing, failing, or being allowed to reappear based on the marks obtained. If marks in A are less than 45, the student fails. Otherwise, it checks further conditions on A and B marks to determine the result.

Uploaded by

pontas97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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();
}

You might also like