Programming in "C‟ | Write a „C‟ program to accept the marks of three subjects and display total marks and average marks.

#include<stdio.h>

#include<conio.h>

void main()

{

float m1,m2,m3,total,avg;

clrscr();

printf("Enter marks of three subjects:");

scanf("%f%f%f",&m1,&m2,&m3);

total=m1+m2+m3;

avg=total/3;

printf("\n Total=%f",total);

printf("\n Average=%f",avg);

getch();

Post a Comment

0 Comments