3/07/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

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To 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