Home / C Programming / Arrays :: Discussion

Discussion :: Arrays

  1. What will be the output of the following program?

    void main()

    {

    char str1[] = "abcd";

    char str2[] = "abcd";

    if(str1==str2)

    printf("Equal");

    else

    printf("Unequal");

    }

  2. A.

     Equal

    B.

     Unequal

    C.

     Error

    D.

     None of these.

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Strings are compared using strcmp() function defined under string.h header file.


Be The First To Comment