Comments in C Language
In the C Programming Language, you can place comments in your source code that are not executed as part of the program. … A comment starts with a slash asterisk /* and ends with a asterisk slash */ and can be anywhere in your program. Comments can span several lines within your C program.
1) Single Comments.(//)
#include<stdio.h>
int main ()
{
// printf("Hello World");
// return 0;
}
2) Multiline Comments(/* */)
#include<stdio.h>
int main ()
{
/* printf("Hello World");
return 0;*/
}
How do you comment in C program?
A comment starts with a slash asterisk /* and ends with a asterisk slash */ and can be anywhere in your program. Comments can span several lines within your C program. Comments are typically added directly above the related C source code.
How do you comment out code in C?
In the C/C++ editor, select multiple line(s) of code to comment out. To comment out multiple code lines right-click and select Source > Add Block Comment. ( CTRL+SHIFT+/ ) To uncomment multiple code lines right-click and select Source > Remove Block Comment.