Thursday, January 12, 2012

AVERAGE OF FOUR SUBJECT


#include<stdio.h>
#include<conio.h>
void main()
{
int m1,m2,m3,m4;
float avg;
clrscr();
printf("Enter the marks of subject_1: ");
scanf("%d",&m1);
printf("Enter the marks of subject_2: ");
scanf("%d",&m2);
printf("Enter the marks of subject_3: ");
scanf("%d",&m3);
printf("Enter the marks of subject_4: ");
scanf("%d",&m4);
avg=(m1+m2+m3+m4)/4.0;           //type conversation from int to float
printf("\nAverage percentage marks are %f",avg);
getch();
}

1 comment:

  1. Looking for a hassle-free pathway to secure a seat at Vydehi Medical College? College Dhundo offers valuable insights on "Direct Admission In Vydehi Medical College Direct Admission In Vydehi Medical College Explore this informative resource to simplify your admission process and achieve your medical education goals.

    ReplyDelete