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.
Problem Statement: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example…
Given an integer A. Compute and return the square root of A. If A is…
Given a zero-based permutation nums (0-indexed), build an array ans of the same length where…
A heap is a specialized tree-based data structure that satisfies the heap property. It is…
What is the Lowest Common Ancestor? In a tree, the lowest common ancestor (LCA) of…