Question: 4. (10 marks) Implement the following code: #include int main(void) float MyNum=0; int j; printf(Please enter a number); fflush(stdin); scanf(%f, &MyNum); j = (int) (MyNum*100.0

 4. (10 marks) Implement the following code: #include int main(void) float
MyNum=0; int j; printf("Please enter a number"); fflush(stdin); scanf("%f", &MyNum); j =

4. (10 marks) Implement the following code: #include int main(void) float MyNum=0; int j; printf("Please enter a number"); fflush(stdin); scanf("%f", &MyNum); j = (int) (MyNum*100.0 +0.5); MyNum = (float)j / 100.0; printf("The new value is: %f", MyNum): a. For the above program enter the value of 123.444 and record what value is displayed on the screen: Result = b. For the above program enter the value of 123.447 and record what value is displayed on the screen: Result = C. Explain the important points regarding how the code works

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!