1. Home
  2. MCQs by exam
  3. NTS
  4. Computer Science MCQs

NTS MCQs – Computer Science MCQs · Page 10

455 multiple choice questions typical of the NTS exam, with answers and explanations. Switch on practice mode to test yourself first.

Showing 226–250 of 455

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