# Write a c program for Calculation of aggregate and percentage marks

## Problem Statement:

If the marks obtained by a student in five different subjects are input through the keyboard, find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100.

/* Calculation of aggregate and percentage marks */

#include<stdio.h>
#include<conio.h>

main()
{
int m1, m2, m3, m4, m5, aggr;
float per;

clrscr();
printf(“\n Enter marks in 5 subjects:”);
scanf(“%d %d %d %d %d”, &m1, &m2, &m3, &m4, &m5);

aggr=m1+m2+m3+m4+m5;
per=aggr/5;

printf(“\n Aggregate Marks=%d”,aggr);
printf(“\n Percentage Marks=%d”,per);

printf(“\n\n\n\n\n Press any key to exit….”);
getch();
}

Please run this program and share the output with us.

## Related Posts

• 71
Problem Statement: Write a program to calculate the salary as per the following table: Solution: /* C program to calculate salary */ main( ) { char g ; int yos, qual, sal ; printf ( "Enter Gender, Years of Service and Qualifications ( 0 = G, 1 = PG ):" )…
Tags: program, calculate, example, write, learn, tutorial, programming, basic
• 60
Problem Statement: If a four-digit number is input through the keyboard, write a program to obtain the sum of the first and last digit of this number. Solution: /* Sum of 1st and last digit of a four digit number */ #include<stdio.h> #include<conio.h> main() { int n,a,sum=0; clrscr(); printf("\Enter a…
Tags: program, write, learn, example, tutorial, programming, basic
• 59
C allows usage of three logical operators, namely, &&, || and !. These are to be read as ‘AND’ ‘OR’ and ‘NOT’ respectively. There are several things to note about these logical operators. Most obviously, two of them are composed of double symbols: || and &&. Don’t use the single…
Tags: program, printf, percentage, student, subjects, marks, learn, write, programming, tutorial
• 59
Write a C Program for the following :- Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary. Answer:  /* To Calculate the gross salary of Ramesh…
Tags: basic, printf, program, write, calculate, #include, tutorial, learn, example
• 57
Since we have now added the logical operators to the list of operators we know, it is time to review these operators and their priorities. The higher the position of an operator is in the table, higher is its priority. The following figure summarizes the working of all the three…
Tags: learn, program, programming, example, write, tutorial, basic

#### Satya Prakash

VOIP Expert: More than 8 years of experience in Asterisk Development and Call Center operation Management. Unique Combination of Skill Set as IT, Analytics and operation management.