Question: Write a program ( wk 0 3 - a . c ) that prompts the user for an integer. The program will use a for

Write a program (wk03-a.c) that prompts the user for an integer. The program will use a for loop that runs as many times as the user entered, up to 10(add 1 each time the loop runs). If a user enters a value above 10 the loop will never run. Inform the user what they entered using a printf statement. Once the for loop has finished in the program then it finds the size (use sizeof) of the following 5 data types inBYTES: FIVE Total - integer, short integer, long integer, float and double, so the sizeof should run only ONE time, even if the value entered is above 10. Warn the user what will happen when an incorrect value is entered (not a number), so run the program many times to see the results.

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 Programming Questions!