Search This Blog


Showing posts with label print all even numbers under 100. Show all posts
Showing posts with label print all even numbers under 100. Show all posts

Wednesday, 10 April 2019

April 10, 2019

C Program To Calculate Sum of 5 Subjects And Find Percentage

C Program to calculate sum of 5 subjects & find percentage 

Hey Guys,Welcome back.
In this tutorial i am giving tutorial on How to calculate Sum of 5 Subjects and how to find Percentage of all 5 subjects using C program.

CODE

#include<stdio.h>
int main()
{
int a,b,c,d,e,sum,per;                          //a,b,c,d,e are 5 subjects
printf("\n ENTER MARKS OF 5 SUBJECT");
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&e);

sum=a+b+c+d+e;
per=sum/500*100;

printf("\n SUM = %d",sum);
printf("\n PERCENTAGE = %d",per);
}

OUTPUT