Earn while u Learn

Tips tweaks hacks on computer with C C++ VB tutorials and ways to earn money online

ad

total and average of 5 subject marks in c

This program is for calculating total and average of 5 subject marks in c.

CODE:
__________________________________________________________

#include(stdio.h)
#include(conio.h)

main()
{
float avg;
int a,b,c,d,e, total;
printf("enter the marks in five different subjects");
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
total=a+b+c+d+e;
avg=total/5;
printf("Total = %d\n Average=%d\n",total,avg);
getch();
}

0 comments:

Sign in / Join

Labels