Computer Science, asked by chadkhanameena9986, 1 year ago

Write an algorithm to input marks of a student and display wether he passed or fail

Answers

Answered by sangeeta7701
5

A university has the following rules for a student to qualify for a degree with A as the main subject and B as the subsidiary subject:

- He should get 55% or more in A and 45% or more in B.

- If he gets less than 55% in A he should get 55% or more in B.

However, he should get at least 45% in A.

- If he gets less than 45% in B and 65% or more in A he is allowed to reappear in an examination in B to qualify.

- In all other cases he is declared to have failed.

Write a program to receive marks in A and B and output whether the student has passed, failed or is allowed to reappear in B.

Code for Program to receive marks in 2 subjects and output whether the student has passed, failed or is allowed to reappear in any subject in C Programming

# include<stdio.h>

void main()

{

int a,b;

clrscr();

printf("Enter marks for subject A : ");

scanf("%d",&a);

printf("Enter marks for subject B : ");

scanf("%d",&b);

if(a>=55 && b>=45)

printf("Result : PASS");

// else if(b>=55 && a>=45)elseif((a<55 && a>=45) && b>=55)

printf("Result : PASS");

elseif(b<45 && a>=65)

printf("You can re-appear for subject B");

else

printf("Result : FAIL");

getch();

}

Hope it helps you :-)

Please mark it breainliest answer if you like it and follow me!!

Similar questions