A university has the following guidelines for a scholar to qualify for a diploma with A as the principal subject and B as the subsidiary subject:
(a) He have to get 55 percentage or more in A and forty five percentage or more in B.
(b) If he gets than fifty five percent in A he need to get fifty five percentage or greater in B. However, he should get at least 45 percentage in A.
(c) If he gets less than forty five percent in B and 65 percentage or more in A he is allowed to reappear in an examination in B to qualify.
(d) In all other instances he is declared to have failed.
Write a software to get hold of marks in A and B and Output whether the pupil has passed, failed or is allowed to reappear in B.
(a) He have to get 55 percentage or more in A and forty five percentage or more in B.
(b) If he gets than fifty five percent in A he need to get fifty five percentage or greater in B. However, he should get at least 45 percentage in A.
(c) If he gets less than forty five percent in B and 65 percentage or more in A he is allowed to reappear in an examination in B to qualify.
(d) In all other instances he is declared to have failed.
Write a software to get hold of marks in A and B and Output whether the pupil has passed, failed or is allowed to reappear in B.
#include<iostream>
using namespace std;
int main()
{
int subject_A;
int subject_B;
cout << "Enter your marks obtained in Subject A: " << endl;
cin >> subject_A;
cout << "Enter your marks obtained in Subject B: " << endl;
cin >> subject_B;
if(subject_A >= 55 && subject_B >= 45){
cout << "congratulation! you have passed: " << endl;
}
else if( subject_A < 55 || subject_A < 45 && subject_B >= 65 ){
cout << "Congratulation! You have passed: " << endl;
}
else if(subject_B <= 45 && subject_A > 65 ){
cout << "Please reappear in examination in B to qualify: " << endl;
}
else
cout << "sorry! you are failed: " << endl;
}
0 comments:
Post a Comment
If You Have Any Problem While Downloading Comment Below