Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    char *s1 = "Hey Bro...\n";
    char s2[] = "How are u?\n";
    strcpy(s2, s1);
    printf("%s\n", s2);
    return 0;
    }
    1. How are u?
    2. Hey Bro...
    3. Hey Bro...
      How are u?
    4. Segmenation fault
    5. Undefined behaviour
Correct Option: B

Hey Bro...



Your comments will be displayed only after manual approval.