QP School

Full Version: Commenting out a part of a line in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Example:

int x = 10; // Initialize x to 10
int y = 20; // Initialize y to 20
// int z = x + y; // This line is commented out

Explanation:

Single-line comments can be used to comment out a portion of a line, rather than the entire line.
In this example, the third line is partially commented out to exclude the calculation of z.