Saturday, 7 March 2015

C Program To Find A Percentage Of Marks

Problem :- Write A C Program To Find A Percentage Of Marks .

Logic :- First We take input marks Of All 6 Subject from User ,then we add all subject and after that divide by number or subject 

Formula :- 

Percentage = Sum of all Subject / Number of Subject 

Solution :-

#include<stdio.h>
main()
{
int ph,ch,math,eng,sc,sci;
float per;

printf("Enter The Marks Of Subject ph,ch,math,eng,sc,sci\n");
scanf("%d%d%d%d%d%d" ,&ph,&ch,&math,&eng,&sc,&sci);

per=(ph+ch+math+eng+sc+sci)/6;

printf("\nPercentage = %f\n",per);


}

Output:-

C Program To Find A Percentage Of Marks

Ghanendra Yadav
Ghanendra Yadav

I Am Ghanendra Yadav Owner Of This Website. I Love Programming, Web Developing, Logo Making, Banner And Website designing. Currently I Am Studying In NIT Warangal And Also Working With WSDC( As Web Application Developer ) In NIT Warangal For Any Query Mail Me I Will Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

No comments:

Post a Comment