Input/Output Quiz


Identification:

Last Name:     

First Name:    

Class Section: 

Type the letter of the term which best

matches the following descriptions:

Terms
a) scanf b) %i c) "Hello \n"
d) printf e) %f f) \n
g) \t h) %c i) %.2f

Descriptions
1. Format String 2. Used for Input 3. Used for Output
4. Format Character for an integer 5. Format Character for a float 6. Format Character for a character
7. Format Character for a float with 2 decimal places 8. Tab 9. Newline

Put the letter of the best answer for the following:

10. Assume that a variable X has been declared to be of type integer and assigned a value. How can you print out its value: a. printf ("The value of X is X \n", X); b. printf ("The value of X is %i \n", X); c. printf ("The value of %i is %i \n"); d. printf ("The value of X is %i \n"); e. none of the above. Answer: 11. Assume that a variable F has been declared to be of type float. How could you assign a value to F when your program runs: a. scanf ("F = %f", F); b. scanf ("F = %f", &F); c. scanf ("%f", &F); d. scanf ("%f", F); e. scanf ("%&F", F); Answer: 12. In a scanf statememt, if there is a & symbol, it means: a. Logical And b. Scanf Operator c. Address Operator d. Newline e. None of the above. Answer: