If the marks obtained by a student in five different subjects are input through the keyboard, write a program to 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.

 If the marks obtained by a student in five different subjects are input through the keyboard, write a program to 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.


/*Calucation of aggregate percentage marks*/

#include <stdio.h>

#include <conio.h>

void main()

{

int m1,m2,m3,m4,m5,aggr;

float per;

clrscr();

printf ("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 ("Agregate Marks=%d\n", aggr);

printf ("Percentage Marks=%f\n", per);

getch();

}




OutPut:-


Enter marks in 5subjects: 85 75 60 72 56

Aggregate Marks = 348

Percentage Marks = 69.000000



Note:-

If you are a beginner then you must have to practice daily. Must see our previous posts regarding C programming.

Comments

Popular posts from this blog

C-programming Introduction (Notes).

My Resume / Achievements.

All about hacking.