What will be the output of the following C code? [code] #include <stdio.h> int main() { char *str = "hello world";

Stasenndb

New member
What will be the output of the following C code?
Code:
    #include <stdio.h>
    int main()
    {
        char *str = "hello world";
        char strc[] = "good morning india\n";
        strcpy(strc, str);
        printf("%s\n", strc);
        return 0;
    }
A. hello world
B. hello worldg india
C. Compile time error
D. Undefined behaviour
 

Tìm kiếm

Back
Top