+1 vote
in Programming Languages by (60.0k points)
retagged by
How can I comment a single line and multiple lines in C language?

1 Answer

+2 votes
by (77.2k points)
selected by
 
Best answer

To comment a single line, you should use two forward slashes (//).

To comment multiple lines, you should write text between /* and */.

Here is an example:

#include <stdio.h>

// This is a single line comment

/* This is a multi-line comment

This is a multi-line comment*/

int main() {

  printf("Showing single line and multi-line comments in C\n");

  return 0;

}

Related questions

+1 vote
1 answer
+1 vote
1 answer
+2 votes
1 answer
+5 votes
1 answer

...