Saturday, August 9, 2014

Program to find percentage

Simple Program to find Percentage. Pretty simple.
#include <stdio.h> main() { int a,b,c,d,e,tot,sum,perc; printf("enter the marks of 5 subjects"); scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); printf("enter the total"); scanf("%d",&tot); sum=a+b+c+d+e; perc=(sum/tot)*100; printf("percentage of 5 subjects are %d",perc); }

No comments:

Post a Comment