Examveda
Examveda

What will be the output of the following C code?
#include <stdio.h>
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: Option D


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer