# Calculate Percentage of 5 Subjects in C

Calculate Percentage of 5 Subjects in C. In this program, we can learn how to calculate the percentage of marks of 5 subjects in the c program. Using this c program you can calculate different five subjects in c.

## Calculate Percentage of 5 Subjects in C

The number of values below ‘x’ divided by the total number of values yields the percentile. Percentile Formula is a formula that calculates the percentage of a population.

Percentile (P) = (Number of Values Below “x” / Total Number of Values) / 100 is the Percentile formula. How to calculate percentage in c for freshers to understand the concept of switch statement. This is how to find the percentage of two numbers in java.

## Grading System in Education

In general, the grading system is the process by which educators evaluate students’ performance in exams on standard particular scales that are entirely based on points and consist of grades like A-F or ranges like 1-10; generally, letters and numbers are used to describe student grades.

## Floating Number in C

The term “floating point” is abbreviated as “float.” It’s a built-in data type that’s used to define numeric values with floating decimal points, according to the definition.

Float is a data type that is recognised by C, C++, C#, and many other programming languages.

## Nested if Statement in How to Calculate Percentage

In C, a nested if statement is one that is the target of another if statement. An if statement inside another if statement is referred to as nested if statements.

Yes, both C and C++ allow us to nest if statements within if statements, allowing us to put one if statement inside another. This is sample program to calculate the percentage in c.

## .2f in C Program

The “.2” tells your “print” to print only the first two digits after the point. “print” treats the percent as a special character you must add so it knows that when you type “f,” the number result that will be printed is a floating point type, and the “.2” tells your “print” to print only the first two digits after the point.

``````#include <stdio.h>
int main()
{
float sub_1, sub_2, sub_3, sub_4, sub_5;
float final, avg, perc;
printf("Enter the marks of five subs\n");
scanf("%f%f%f%f%f", &sub_1, &sub_2, &sub_3, &sub_4, &sub_5);
final = sub_1 + sub_2 + sub_3 + sub_4 + sub_5;
avg = final / 5.0;
perc = (final / 500.0) * 100;
if (avg >= 90)
else if (avg >= 80 && avg < 90)
else if (avg >= 70 && avg < 80)
else if (avg >= 60 && avg < 70)
else
printf("\nThe final marks is: \t%.2f / 500.00\n", final);
printf("\nThe avg marks is:\t%.2f\n", avg);
printf("\nThe perc is: \t%.2f%%\n", perc);
return 0;
}
``````

Output:

Enter the marks of five subs
45
6
76
87
34

The final marks is: 248.00 / 500.00

The avg marks is: 49.60

The perc is: 49.60%

The Grade is: ‘E’
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://inlarn.com/how-to-calculate-percentage-of-marks-of-5-subjects/", "fetch_time": 1643078441000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2022-05/segments/1642320304749.63/warc/CC-MAIN-20220125005757-20220125035757-00282.warc.gz", "warc_record_offset": 360831629, "warc_record_length": 13109, "token_count": 750, "char_count": 2836, "score": 3.609375, "int_score": 4, "crawl": "CC-MAIN-2022-05", "snapshot_type": "latest", "language": "en", "language_score": 0.9099286794662476, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00059-of-00064.parquet"}