What will be the output of the following code snippet? char str [] = {'h',…

What will be the output of the following code snippet?

char str [] = {'h', 'e', 'l', 'l', 'o', '\0'};

str[0] = 'y';

printf("%s", str);

  1. A.

    hello

  2. B.

    yello

  3. C.

    ello

  4. D.

    hyello

Attempted by 7 students.

Sign up free to check your answer

Sign up free

Explore the full course: C Language

Loading lesson…