write a c program to get total of marks of 5 subjects along with % of student


/*write a c program to get total of marks of 5 subjects along with % of student*/

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

void main()

{
	float sub1,sub2,sub3,sub4,sub5,t,p;
	clrscr();

	printf("enter marks of 5 subjects:\n");
	scanf("%f %f %f %f %f",&sub1,&sub2,&sub3,&sub4,&sub5);

	t=sub1+sub2+sub3+sub4+sub5;

	printf("\ntotal of subjects:%.2f",t);

	p=t/5;
	printf("\npersentage of the student:%.2f",p);

	getch();
}

No comments:

Post a Comment