Friday, January 9, 2015

Average of given five Numbers

#include<stdio.h> main()

{

int m1,m2,m3,m4,m5,tot; float avg;

printf("Enter 5 Marks\n"); scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5); tot=m1+m2+m3+m4+m5;
avg=tot/5;
printf("\nThe Average is %f\n",avg);

}

OUTPUT:

Enter 5 Marks 

1  2  3  10  25





The Average  is 20.5

No comments:

Post a Comment