Examveda

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

A. helloworld

B. Undefined behaviour

C. helloworl

D. hellowor

Answer: Option A


This Question Belongs to C Program >> File Input Output

Join The Discussion

Related Questions on File Input Output