C comments within a statement

By: IncludeHelp, on 07 FEB 2017

I have discussed about the comments, we can put a comments anywhere in the program by using comment characters /*...*/

But, do you know? We can also put a comment within the statement by using the same comment characters.

Consider the following statement

if(a>=b && a!=0)
	printf("some statement.\n");

If we do not want to check a!=0, we can put this expression with && operator in the comment, like this:

if(a>=b /*&& a!=0*/)
	printf("some statement.\n");

Now, program will check only a>=b.


Related Tutorials



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.