Breaking News

Photo in News

Sum and % of 5 subjects- c program

This program will find the sum and % of 5 subjects.

/*
Developed by deepak anand.
For more programs,
visit programming-stuff-4-u.blogspot.in
*/
#include<stdio.h>
#include<conio.h>
void main()
{
 int s1,s2,s3,s4,s5,sum,total=500;
 float per;
 clrscr();
 printf("\nEnter marks of 5 subjects : ");
 scanf("%d%d%d%d%d",&s1,&s2,&s3,&s4,&s5);
 sum = s1 + s2 + s3 + s4 + s5;
 printf("\nSum : %d",sum);
 per = (sum * 100) / total;
 printf("\nPercentage : %f",per);
 getch();
}

No comments:

Total Pageviews

  • Posts
  • Comments
  • Pageviews
Designed By Blogger Templates