Write a programming C to calculate of any subjects and find   percentage

#include<stdio.h>
#include<conio.h>
void main()
{
   clrscr();
   int s1,s2,s3,s4,s5,sum;
   float avg;
 
   printf("Enter the Marks of Five Subjects");
   scanf("%d %d %d %d %d",&s1,&s2,&s3,&s4,&s5);

   sum=s1+s2+s3+s4+s5;
   avg=sum/5;

   printf("\n total marks in five subjects:");
   printf("%d",sum);
   printf("\n Percents of subjects:");
   printf("%f",avg);
 
   getch();
}  

Comments

Post a Comment

Popular posts from this blog