/* 1. Below code will accept entries from the student for marks obtained in 3 subject i.e. Physics, Chemistry and Mathematics 2. System will then check for mark in each subject are > 33% 3. Furthe it will check if student have obtained >= 40% overall 4. If > 40% then Pass else Fail 5. Considerations: Each paper is of 100 marks */ #include <stdio.h> int main() { // variable declaration and initialization int mark_physics; int mark_chemistry; int mark_biology; // accept user inputs printf("Please enter the marks you obtained in Physics, Chemistry and Biology: "); scanf("%d", &mark_physics); //, "%d", &mark_chemistry, "%d", &mark_biology); printf("\nPlease enter the marks you obtained in Chemistry: "); scanf("%d", &mark_chemistry); printf("\nPlease enter the marks you obtained in Biology: "); scanf("%d", &mark_biology); // show user the inputs printf("\n\nMarks you entered for \nPhysics: %d\nChemistry: %d\nBiology: %d\n", mark_physics,mark_chemistry,mark_biology); //Check if mark obtained in each subject are > 33% //Print Results printf("\nFINAL RESULT "); if ((mark_physics >= 33) && (mark_chemistry >= 33) && (mark_biology >= 33)) { if ((mark_physics+mark_chemistry+mark_biology) >=120) { printf("\nCongratulations - You have successfully passed the exam"); } else if ((mark_physics+mark_chemistry+mark_biology) < 120) { printf("\nEven you passed in all 3 subjects but couldn't score 40 percent\nor more, so you failed"); } } else { printf("\nYou failed as you couldn't scored 33 percent in all subjects.\nPlease try Next Time"); } }