Welcome Guest | Sign in | Register
Inbuilt Functions - Discussion Page For Q.10688 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Inbuilt Functions > Questions and Answers

Q: What will be the output of following C code?

main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
}
A. No output B. Error
C. Compiler Error D. Strings are not equal

Answer and Explanation

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.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved 2012-2015 SoftLucent.