CSE 12 Gillespie Everythang
Write the decimal value that represents all 1s for 32 bits as a signed value:
-1
Convert 0xd to binary:
13 -> 1101
What is the effect on the stdin buffer when the only the following keystrokes are entered: A B backspace:
stdin is unaffected bc they all go in keyboard buffer instead.
In C, in your writeline function, you have a loop of printing characters terminating when processing what character: '\0'
'\0'
What character exists at the end of all strings in C and C++:
'\0'
Assuming the user inputs a short valid string, in your getaline function, you have a loop of processing characters terminating when processing what character:
'\n'
Assuming the user inputs a valid number, in your decin function, you have a loop of processing characters terminating when processing what character:
'\n'
What character is the last one entered in every user response in C, C++ and Java when reading from standard input:
'\n'
Convert to hexadecimal:
0000 1100 0000 1111 1111 1110 1110 000 C0FFEE0
Convert 0x5 to binary:
0101
Convert to hexadecimal: 0000 1111 1110 1110 1101 1101 1010 1101:
0x0FEEDDAD (
Assuming a 4 bit unsigned word, convert the binary number 0101 to hexadecimal:
0x5
Assuming a 4 bit unsigned word, convert the binary number 1000 to hexadecimal:
0x8
Assuming a 4 bit unsigned word, convert the binary number 1111 to hexadecimal:
0xF
Write the hexadecimal value that represents all 1s for 32 bits:
0xFFFFFFFF
Convert 0x9 to binary:
1001
How many binary digits are needed to represent one hexadecimal digit?
4
In C, what is the minimum character array size need to store the string: "ABC"?
4 C
List two situations that cause the standard output buffer to be displayed to the screen when running a C program?
Carriage return and asking for input. Also buffer full, explicit flush, program terminated
Should you print a NULL character in writeline?
No (off by one)
When the standard input buffer is empty and your program calls fgetc, what is the resultant behavior of your program:
Waits for input from user
What sequence of keystrokes causes CSE 12 programs to terminate normally:
^D
In Java, C or C++ code, when a number begins without a prefix, what do you know about that number: (example: int zzz =12;)
decimal
In Java, C or C++ code, when a number begins with a leading 0x, what do you know about that number: (example: int zzz =0x12;)
hexadecimal
In Java, C or C++ code, when a number begins with a leading 0, what do you know about that number: (example: int zzz = 012;)
octal
In your baseout function, when processing a small positive number, you have a loop of processing that number terminating when what condition is met?
when quotient is zero