Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 130

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 65

Answer:

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.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 130 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: