C program to read marks and print percentage and division
Given (or input from the user) marks in 3 subjects and we have to calculate parentage and print the division.
Formula to get percentage: Total obtained marks *100/Grand total (total of maximum marks)
Division
Based on the percentage, we will print the division, if percentage is:
- Greater than or equal to 60, division will be "First"
- Greater than or equal to 50, division will be "Second"
- Greater than or equal to 40, division will be "Third"
- Less than it (we will not check any condition, it will be written in else), the result will be fail
Consider the program:
Output
This is a simple C program, if you are a beginner you will learn to calculate total, percentage and how to find division (example of multiple if else).
If liked or any issue with the program, feel free to leave your comment.
need an explanation for this answer? contact us directly to get an explanation for this answer