C program that finds 5 subjects total marks and Average of that numbers.

Program 

#include<stdio.h>
#include<conio.h>
void main()
int sub1,sub2,sub3,sub4,sub5,sum;
float average;
clrscr();

printf("Enter marks of subject 1:\t");
scanf("%d",&sub1);
printf("Enter marks of subject 2:\t");
scanf("%d",&sub2);
printf("Enter marks of subject 3:\t");
scanf("%d",&sub3);
printf("Enter marks of subject 4:\t");
scanf("%d",&sub4);
printf("Enter marks of subject 5:\t");
scanf("%d",&sub5);

sum=sub1+sub2+sub3+sub4+sub5;
average=sum/5;
printf("Total marks obtained =%d\n",sum);
printf("Average of the given data =%f",average);
getch();
}

Output :



Comments