C program, algorithm, flowchart & explanation of the program that accepts marks of 5 subjects and finds the sum and percentage marks obtained by the student.

WAP that accepts the marks of 5 subjects and finds the sum and percentage marks obtained by the student.

Write a C program that accepts the marks of 5 subjects and finds the sum and percentage marks obtained by the student:-

Here, we have to write a simple C program that takes marks obtained in different subjects by the user and gives total marks and percentage values as output.

Formula used:-

Percentage= (sum/500)*100

Explanation & Program code:-

We will ask the user to enter the marks of different subjects, then we will store the entered marks in the respective variables. Based on the entered marks of different subjects, we will calculate the total marks and percentage. Further details are mentioned as comments in the program code.

Output:-

Algorithm of program that accepts the marks of 5 subjects and finds the sum and percentage marks obtained by the student:-

Step 1:- Start.
Step 2:- Declaration of variables.
Step 3:- Read the marks of 5 subjects and store it to respective variables.
Step 4:- Add all 5 variables that contain marks of subjects and store them to a new variable called sum.
Step 5:- Print sum(Total marks).
Step 6:- Percentage=(sum/500)*100. (Assuming Maximum marks of each subject is 100)
Step 7:- Print Percentage.
Step 8:- Stop.

Flowchart of the program that accepts the marks of 5 subjects and finds the sum and percentage marks obtained by the student:-

flowchart for the program that accepts the marks of 5 subjects and finds the sum and percentage marks obtained by the

As you have reached the end of the article, so I hope as of now you have a clear understanding of the algorithm, flowchart, and program code that accepts the marks of 5 subjects and finds the sum and percentage marks obtained by the student. Please let me know your queries, suggestion, and feedback in the comment section.

Leave a Comment

Your email address will not be published. Required fields are marked *