Rewrite the program with a little bit of changes in the codes...
Rewrite the program with a little bit of changes in the codes...
#include <stdio.h>
int main()
{
int MARK1, MARK2, MARK3, MARK4, MARK5;
float TOT, AVG;
printf("\nPlease enter a number ");
scanf("%d", &MARK1);
printf("\nPlease enter a number ");
scanf("%d", &MARK2);
printf("\nPlease enter a number ");
scanf("%d", &MARK3);
printf("\nPlease enter a number ");
scanf("%d", &MARK4);
printf("\nPlease enter a number ");
scanf("%d", &MARK5);
TOT = MARK1 + MARK2 + MARK3 + MARK4 + MARK5;
AVG = TOT / 5.0;
printf("\nNumber entered %d", MARK1);
printf("\nNumber entered %d", MARK2);
printf("\nNumber entered %d", MARK3);
printf("\nNumber entered %d", MARK4);
printf("\nNumber entered %d", MARK5);
printf("\nTotal %f", TOT);
printf("\nAverge %f", AVG);
return 0;
}
Step by step
Solved in 3 steps with 2 images