C program to find student is pass or fail in examination

 

C program to find student is pass or fail in examination
 

/************************************

 C program to find student is pass or fail in examination

 ****************************************************/

 

 #include<stdio.h>

 #include<conio.h>

 void main()

 {

     float sub1,sub2,sub3,sub4,sub5,obtained_marks,percentage;

    clrscr();

     printf("\t\t***Output***\n");

     printf("Enter 5 subjects marks\n");

     scanf("%f%f%f%f%f",&sub1,&sub2,&sub3,&sub4,&sub5);

     obtained_marks=sub1+sub2+sub3+sub4+sub5;

     percentage=100*obtained_marks/500;

     if(percentage>=35)

     printf("Student's percentage is  %f. He/She is pass in examination\n",percentage);

     else

     printf("Student's percentage is  %f. He/She is fail in examination\n",percentage);

     printf("End of program");

 }

                   ***Output***

Enter 5 subjects marks

12 34 10 78 90

Student's percentage is  44.799999. He/She is pass in examination

End of program

टिप्पणी पोस्ट करा

0 टिप्पण्या