Vidyalelo
C Programming · Q203

Pointer

Programming · C Programming · question 203

Q203

What will be the output of the following C code? #include void main() char *a[10] = "hi", "hello", "how"; int i = 0; for (i = 0;i < 10; i++) printf("%s", a[i]);

A.
hi hello how Segmentation fault
B.
hi hello how null
C.
hey hello how Segmentation fault
D.
hi hello how followed by 7 nulls
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board