Showing posts with label Average of 3 Subjects. Show all posts
Showing posts with label Average of 3 Subjects. Show all posts

Sunday, October 31, 2010

Program to find total marks & Percentage of three subjects

 PROGRAM 3
 
#include<stdio.h>
#include<conio.h>

void main ()
{
  int m1,m2,m3;
  float tm,per;
  clrscr ();
  printf ("Enter M1: ");
  scanf ("%d",&m1);
  printf ("Enter M2: ");
  scanf ("%d",&m2);
  printf ("Enter M3: ");
  scanf ("%d",&m3);
  tm=m1+m2+m3;
  per=(tm/300*100);
  printf ("\nTotal Marks are %.2f",tm);
  printf ("\nPercentage is %.2f",per);
  getch ();
}

OUTPUT
Enter M1:45
Enter M2:58
Enter M3:62
Total Marks are 165.00
Percentage is 55.00