Tuesday, October 23, 2012

Question 12: Predict the output.
    int main()
    {
        char str1[] = "India";
        char str2[] = "India";
        if(str1 == str2)
        {
            std::cout<<"Both the strings are same";
        }
        else
        {
            std::cout<<"Both the strings are not same";
        }
    }



    Options:
    (a) Both the strings are same
    (b) Both the strings are not same
    (c) Compile Time error
    (d) Runtime Error


    Answer: b

No comments:

Post a Comment