fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. float sub1,sub2,sub3,sub4,sub5,total,percentage;
  5. printf("Enter the value of 5 subjects:");
  6. scanf("%f %f %f %f %f",&sub1,&sub2,&sub3,&sub4,&sub5);
  7. total=sub1+sub2+sub3+sub4+sub5;
  8. percentage=total/5;
  9. printf("%f",total);
  10. printf("%f",percentage);
  11. return 0;
  12. }
  13.  
  14.  
  15.  
Success #stdin #stdout 0.01s 5324KB
stdin
100
stdout
Enter the value of 5 subjects:100.00000020.000000