C Program to calculate sum of marks of 5 subjects and find percentage

#include
void main()
{
 float a,b,c,d,e,f;
 printf("enter marks in 1st subject\n");
 scanf("%f",&a);
 printf("enter marks in 2nd subject\n");
 scanf("%f",&b);
 printf("enter marks in 3rd subject\n");
 scanf("%f",&c);
 printf("enter marks in 4th subject\n");
 scanf("%f",&d);
 printf("enter marks in 5th subject\n");
 scanf("%f",&e);
 f=(a+b+c+d+e)/5;
 printf("Sum is %f\n",a+b+c+d+e);
 printf("percentage is%f\n",f);
}
Output:

C Program to calculate sum of marks of 5 subjects and find percentage C Program to calculate sum of marks of 5 subjects and find percentage Reviewed by Prashant Sengar on December 21, 2017 Rating: 5

No comments:

Powered by Blogger.