ProAnswers.org

Write a C program to find out the Sum and Percentage of five Marks?

#include

#include 

void main() 

{ 

int a,b,c,d,e,s; 

float x; 

clrscr(); 

printf(“enter the 5 marks:

”);

scanf(“%d%d%d%d%d”,&a,&b,&c,&d,&e”) 

s=a+b+c+d+e; 

x=s/5; 

printf(“sum=%d 

percentage=%f
”,s,x);

getch(); 

} 

Output: 

enter the 5 marks: 

87 

98 

78 

76 

89 

sum=428 

percentage=85.000000