#include <stdio.h>
int main(void) {
float score1;
float score2;
float score3;
float value;
printf("Please enter three exam score: ");
scanf("%f", &score1);
scanf("%f", &score2);
scanf("%f", &score3);
printf("First exam: %.1f", score1);
printf("%%\\n");
printf("Second exam: %.0f", score2);
printf("%%\\n");
printf("Third exam: %.0f", score3);
printf("%%\\n");
printf("-----------------------------------");
value = (score1 + score2 + score3) / 3.0;
printf("\\n");
printf("Average: %.14f",value);
printf("%%.\\n");
return 0;
}
-here is my code. the three scores are 75.5 92 100
and the average of these is 89.16666666666667%. but I am getting 89.16666412353516%. as the average when I run the program. any help is appreciated!
Thank you -Slurpski