CS 7643 QUIZ 1 PREP SET UPDATED ACTUAL EXAM QUESTIONS CORRECT ANSWERS
GRADED A PLUS
Question:
When the standard input buffer is empty and your program calls fgetc, what is the resultant behavior
of your program:
Answer:
Wait for input
Question:
Convert 0x9 to binary:
Answer:
1001
Question:
List two situations that cause the standard output buffer to be displayed to the screen when running a
C program?
Answer:
program ends normally and request input from user
Question:
What character is the last one entered in every user response in C, C++ and Java when reading from
standard input:
Answer:
\n
Question:
, Convert 0x5 to binary:
Answer:
0101
Question:
Convert to hexadecimal: 0000 1111 1110 1110 1101 1101 1010 1101
Answer:
0x0FEEDDAD
Question:
Write the decimal value that represents all 1s for 64 bits as a signed value
Answer:
-1
Question:
Should you store the newline character as part of the string formed by getaline?
Answer:
No
Question:
Should you store the NULL character as part of the string formed by getaline?
Answer:
Yes
Question:
Assuming the following line of code in C executed, list one situation where the string is not
displayed to the user: fprintf (stdout, "Hello World");
GRADED A PLUS
Question:
When the standard input buffer is empty and your program calls fgetc, what is the resultant behavior
of your program:
Answer:
Wait for input
Question:
Convert 0x9 to binary:
Answer:
1001
Question:
List two situations that cause the standard output buffer to be displayed to the screen when running a
C program?
Answer:
program ends normally and request input from user
Question:
What character is the last one entered in every user response in C, C++ and Java when reading from
standard input:
Answer:
\n
Question:
, Convert 0x5 to binary:
Answer:
0101
Question:
Convert to hexadecimal: 0000 1111 1110 1110 1101 1101 1010 1101
Answer:
0x0FEEDDAD
Question:
Write the decimal value that represents all 1s for 64 bits as a signed value
Answer:
-1
Question:
Should you store the newline character as part of the string formed by getaline?
Answer:
No
Question:
Should you store the NULL character as part of the string formed by getaline?
Answer:
Yes
Question:
Assuming the following line of code in C executed, list one situation where the string is not
displayed to the user: fprintf (stdout, "Hello World");