Program in C to find out total marks & percentage of three subjects

Write a program in C to find out total marks & percentage of three subjects

#include <stdio.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 ();
}


Post a Comment