Introduction to C language
Sum and average of subjects Program




/*To find the sum and average of given subjects*/

main()
{
int m1,m2,m3,sum;
float avg;
clrscr();
printf("\nEnter 3 subject marsk");
scanf("%d%d%d",&m1,&m2,&m3);
sum=m1+m2+m3;
avg=(float)sum/3;
printf("\nThe sum is %d",sum);
printf("\nThe average is %f",avg);
getch();
}



 
-----------------------------------------------------------------------------------------
please mail comments to vgdarur@gmail.com
 

 

www.iforerunner.com