Tuesday 26 March 2013

while (strcmp(“some”,”some\0”))


    main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
    }
Answer:
No output
Explanation:
Ending the string constant with \0 explicitly makes no difference. So “some” and “some\0” are equivalent. So, strcmp returns 0 (false) hence breaking out of the while loop.
Blog Author: Vijay Kumar

No comments:

Post a Comment