Questions

  1. Correct
  2. Undefine behavior correct
  3. Answer: c
  4. Answer: c - talking about linkage
  5. Variable shadowing
  6. j=7
  7. misleading indentation
  8. data segment
  9. short circuiting
  10. don’t need cast actually

Trivia

  1. ASCII value of A = 65 and Z = 90
  2. ASCII value of a = 97 and z = 122
  3. >> right shift = floor divide by 2
  4. << left shift = multiply by 2
  5. ternary operator is right-associative
  6. printf return value - number of characters transmitted to the output stream or negative value if an output error or an encoding error (for string and character conversion specifiers) occurred.
  7. #define identifier replacement-list (optional)
  8. before arithmetic operations are performed, “narrow integers” (like char and short int) are subject to integer promotions
  9. In C, all uninitialized global and static variables are stored in the BSS segment (Block Started by Symbol), and all initialized global and static variables are stored in the data segment.
  10. WRONG! a pointer variable needs to point to an object not to a literal
  11. When an unsigned type is compared with a signed type in C, the signed operand is implicitly converted to the unsigned type before the comparison is made
  12. String literals in C are typically stored in read-only memory. This means their contents are not intended to be changed during program execution
  13. precision quantifies the amount of detail a floating-point type can hold (e.g., number of significant digits or mantissa bits), while accuracy reflects how close a floating-point value or computation is to its true mathematical counterpart, acknowledging the inherent approximations and limitations of floating-point arithmetic