Comments in C are lines in the code that are not executed by the compiler. They are used to explain the code, increase readability, and make it easier to understand later.
๐๏ธ Note: Comments are ignored during program execution.
//
and continues to the end of the line./*
and ends with */
.#include <stdio.h> int main() { // This is a single-line comment /* This is a multi-line comment */ printf("Hello, World!\\n"); // Prints message return 0; }
/* ...
without ending */
//
for multi-line text (older C compilers may not support it)printf()
statement.main()
function does.Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!