Assume the output of the following code:
#include <stdio.h>
void main()
{
char *a[10] = {"hi", "hello", "how"};
int i = 0, j = 0;
a[0] = "hey";
for (i = 0;i < 10; i++)
printf("%s\n", a[i]);
}
- hey hello how Segmentation fault
- hi hello how Segmentation fault
- hi hello how followed by 7 null values
- Compilation error
Correct Answer:
hey hello how Segmentation fault
need an explanation for this answer? contact us directly to get an explanation for this answer