Write a program to accept three marks and print the average using type qualifier.
/* Write a program to accept three marks and print the
average
using type qualifier.*/
#include <stdio.h>
void main()
{
int m1,m2,m3;
float avg;
printf("Enter
the mark1 : ");
scanf("%d",&m1);
printf("Enter
the mark2 : ");
scanf("%d",&m2);
printf("Enter
the mark3 : ");
scanf("%d",&m3);
avg=(m1+m2+m3)/3.0;
printf("The
average is %.2f\n",avg);
getch();
}
Comments
Post a Comment