comments c code example

Example 1: comment c

// single-line comment

/*
  multi-line
  comment
*/

Example 2: C comment

/* comments in c work like this */

/*they can be one line...*/

/*
...or
multiple
lines
*/

printf("Hello World"); /* you can comment in the same line with code */

Example 3: how to add a comment in c

// This is a single-line comment

/* This is
a multi-line
comment */

Example 4: commenting in c

#include stdio.h
int main(){
  printf("Only this code will be printed.");
//This is a single line comment.
/*
this is a multiple line 
comment
*/
}

Tags:

C Example