Calculate percentage of student

 


Calculate Percentage of Student




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

 *

 Calculate percentage of student

 **************************************************

 * */

 

 #include<stdio.h>

 void main()

 {

     int s1,s2,s3,s4,s5;

     float outof_marks;

     float total_marks;

     float percentage;

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

     scanf("%d%d%d%d%d",&s1,&s2,&s3,&s4,&s5);

     printf("Enter Out of total marks\n");

     scanf("%f",&outof_marks);

     total_marks=s1+s2+s3+s4+s5;

     percentage=100*total_marks/outof_marks;

     printf("The five subjects marks are:\t%d\t%d\t%d\t%d\t%d\n",s1,s2,s3,s4,s5);

     printf("The total of all five subjects is:\t%f\n",total_marks);

     printf("The percentage of student is:\t%f\n",percentage);

     printf("End of program");

    

    

 }

 

Enter five subjects marks

56

57

89

90

99

Enter Out of total marks

500

The five subjects marks are:       56           57           89           90           99

The total of all five subjects is:    391.000000

The percentage of student is:     78.199997

End of program

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

0 टिप्पण्या