Multiple choice c

To declare and initialize character array :

  1. char s[] = { 'a', 'b' , 'c' };

  2. char s[] = "abc";

  3. both correct

  4. both wrong

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Option A declares an array of char initialized with specific character codes. Option B uses a string literal, which implicitly includes a null terminator ('\0'). Both are valid ways to initialize a char array, making C the correct choice.