Friday, 23 August 2013

//program to calculate percentage
#inclue<stdio.h>
#include<conio.h>
int main()
{
 int m1, m2, m3, m4, m5, m6, m7;
double sum;
float percentage;
clrscr();
//accept the marks
Printf("\n Enter the marks of 7 subjects");
scanf("%d| %d|%d| %d|%d| %d|%d|", &m1, &m2, &m3, &m4, &m5,&m6, &m7);
//add the marks of the given subject
sum=m1=m2+m3+m4+m5+m6+m7;
printf("the sum of the marks is %d", sum);
//calculate the percenage of the student
percentage=sum/700*100;
printf("\nThe percenatge of the marks obtained is %d", percentage);
getch();
return(0);
}

No comments:

Post a Comment