Comments in C are an explanation or description of the source code of the program. It helps a developer explain the logic of the code and improves program readability. These comments are not executed by the compiler rather ignored by it.
There are two types of comments in the C language.
Single line Comment:
//code to be commented
Multi-line Comment:
/*
code
.....
.....
.....
to be commented
*/
#include<stdio.h>
int main(){
/*Start of main()
Program to print hello coderzpy
Multi-Line Comment*/
printf("Hello Coderzpy !");
return 0;
//end of main()
}
OUTPUT: Hello Coderzpy !
In the above code /*printing information Multi-Line Comment*/ is the multi line comment whearas, //end of main() is single line comment.
Need for Comments :
note: also read about Variables & Constants in C & Precedence of Operators in C.
If you like my post please follow me to read my latest post on programming and technology.
https://www.instagram.com/coderz.py/
https://www.facebook.com/coderz.py
Staying up to the mark is what defines me. Hi all! I’m Rabecca Fatima a keen learner, great enthusiast, ready to take new challenges as stepping stones towards flying colors.
Find the length of the longest absolute path to a file within the abstracted file…
You manage an e-commerce website and need to keep track of the last N order…
You are given a stream of elements that is too large to fit into memory.…
The formula for the area of a circle is given by πr². Use the Monte…
Given an integer k and a string s, write a function to determine the length…
There is a staircase with N steps, and you can ascend either 1 step or…