Find total marks & percentage - C Program

C program to read marks of five subject and print total marks and percentage of a student.

Solution:

#include <stdio.h>
int main()
{
      int s1,s2,s3,s4,s5,Tot_marks;
      float per;
      printf("Enter Marks of 5-Subjects : \n");
      scanf("%d %d %d %d %d",&s1,&s2,&s3,&s4,&s5);
      Tot_marks=s1+s2+s3+s4+s5;
      per=Tot_marks/5.0;
      printf("\nTotal Marks of Student = %d ",Tot_marks);
      printf("\nPercentage of Student = %.2f",per);
      return 0;
}


Output:

percentage of student