Which character is used to represent a comment in C code?
A. #
B. //
C. /*
D. ;
Answer: Option B
Solution (By Examveda Team)
The character used to represent a comment in C code is Option B://
. In C, the double forward slash (//
) is used to begin a single-line comment. Comments are used for adding explanations or notes within the code that are ignored by the compiler and are solely for human readability.So, the correct answer is:
Option B:
//
Here's an example of a single-line comment in C:
int main() {
// This is a single-line comment
printf("Hello, World!");
return 0;
}
Join The Discussion