fork download
  1. #include<stdio.h>
  2. int main(){
  3. float sub1,sub2,sub3,sub4,sub5,total,percentage;
  4. printf("Enter marks of 5 subjects");
  5. scanf("%f %f %f %f %f",&sub1,&sub2,&sub3,&sub4,&sub5);
  6. total=sub1+sub2+sub3+sub4+sub5;
  7. percentage=total/5;
  8. printf("Aggregate marks=%2f\n",total);
  9. printf("Percentage=%2f\n",percentage);
  10. return 0;
  11. }
Success #stdin #stdout 0s 5324KB
stdin
65 70 75 80 85
stdout
Enter marks of 5 subjectsAggregate marks=375.000000
Percentage=75.000000