Vidyalelo
C Programming · Q187

File Input Output

Programming · C Programming · question 187

Q187

What will be the output of the following C code? #include int main() char str[10] = "hello"; char *str1 = "world"; strncat(str, str1, 9); printf("%s", str);

A.
helloworld
Answer
B.
Undefined behaviour
C.
helloworl
D.
hellowor

Answer: Option A

Solution

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