1. Home
  2. Subjects
  3. Computer Science MCQs

Computer Science MCQs · Page 10

992 multiple choice questions with answers across 24 topics.

Showing 226–250 of 992

What happens when a C program executes char *s = "hello"; s[0] = 'H';?

  1. Undefined behaviour, because the literal is read-only Correct answer
  2. The literal is modified and prints "Hello"
  3. A copy on the heap is modified instead
  4. The compiler automatically allocates writable memory for the literal
MCQSEXAM Read explanation