0% found this document useful (0 votes)
5 views1 page

Calculate Student Marks and Average

Uploaded by

krtiwarianurag
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Calculate Student Marks and Average

Uploaded by

krtiwarianurag
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROGRAM 1

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

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

void main()
{
int m1, m2, m3, m4, m5;
float sum, avg;

clrscr();

printf("Enter marks of Physics:\n");


scanf("%d", &m1);

printf("Enter marks of Mathematics:\n");


scanf("%d", &m2);

printf("Enter marks of PPS\n");


scanf("%d", &m3);

printf("Enter marks of Electrical:\n");


scanf("%d", &m4);

printf("Enter marks of Environment & Ecology:\n");


scanf("%d", &m5);

sum = (m1 + m2 + m3 + m4 + m5);


avg = (sum / 5);

printf("The total marks obtained = %f\n", sum);


printf("Average marks = %f\n", avg);

getch();
}

You might also like