Multi Choice 1 (1)

by harishkiet1





Download: 0

Comment: 0





Download Multi Choice 1 (1)


Multiple Choice Questions for C Beginners Course – Test 1 We will go through these at 8pm – you will have 1½-2 Hours to complete this. I will collect them after the session, so that I can get an idea of which topics I need to go over as a refresher. You will be also be given a second copy. Please use this copy to make any notes / keep a copy for yourself. 1. What is an IDE? a. Internet Debugging Editor b. Integrated Development Environment c. Interdependent element 2. Put these stages of compilation in order:a. Link b. Compilation c. Execute d. Precompilation 3. At which stage are #include and #define identified:a. Precompilation b. Compilation c. Linking 4. Which of these commands would give you access to the printf function:a. include stdio.h; b. #include c. #include conio.h; 5. How would you declare a constant of 5 called "MYCONST"? a. constant MYCONST = 5; b. int myconst = 5; c. #define MYCONST 5 6. How a. b. c. would declare two integers called "i" and "j"? int i, j; int i + j: int i int j; 7. Which of the following declarations could store the number 5.5? a. char num; b. int num; c. float num; 8. What is a variable? a. A place to store single items of data that cannot change b. A place to store a list of data c. A place to store a single item of data that can be overwritten 9. How would you display an integer variable 'i' starting with the text "Total: "? a. printf( 'Total: %i' i ); b. printf( "Total: %d", i ); c. printf( "Total: " + i ) 10. Which of these is NOT a valid name for a C variable: a. Hello There b. HELLO_THERE c. HelloThere 11. What value would be stored in an integer variable "i" as a result of the following calculation: int i, j; j=3; i = 4 + 2 * j / ( j - 1 ); a. 1 b. 7 c. 9 12. Which of the following would read a decimal number into a float variable 'f' from the keyboard? a. readf ( f ); b. scanf ( "%f", &f ); c. scanf ( "&f", f ); 13. Which of the following will NOT increase an integer variable "i" by 1? a. i++; b. i+=1; c. i=i+i; 14. Which of the following loops will NEVER exit (assuming a variable does not have a limit on how larger or small the number it holds can be)? a. int i=0; do { i++; } while (i < 10); b. int i=10; while (i
Fly UP