Comments Example
Let's take another example of comments in a program.
//Program to print Hello World
#include <stdio.h>
int main() {
printf("Hello, World!"); // print Hello World
return 0;
}
Output
Hello WorldHere, the program contains two comments:
// Program to print Hello World// print Hello World
If the computer completely ignores comments, then why do we use them?
Well, the main purpose of using comments is to help other people reading the code understand it.