WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL MARKS AND PERCENTAGE
#include stdio.h>
#include conio.h>
void main()
{
int M1,M2,M3,Total;
float Per;
clrscr();
printf("\n\n\t\t Enter the Marks of First Subject: ");
scanf("%d",&M1);
printf("\n\n\t\t Enter the Marks of Second Subject: ");
scanf("%d",&M2);
printf("\n\n\t\t Enter the Marks of Third Subject: ");
scanf("%d",&M3);
Total=M1+M2+M3;
Per=Total/3;
printf("\n\n\t\t Total Marks of Three Subject is: %d",Total);
printf("\n\n\t\t Percentage is: %f",Per);
if(Per>=70)
printf("\n\n\t\t You got DISTINCTION");
else if(Per>=60&&Per<=70)
printf("\n\n\t\t You got FIRST CLASS");
else if(Per>=50&&Per<=60)
printf("\n\n\t\t You got SECOND CLASS");
else if(Per>=40&&Per<=50)
printf("\n\n\t\t You got PASS CLASS");
else
printf("\n\n\t\t You got FAIL CLASS");
getch();
}
OUTPUT