Rules of Writing Comments
Before Writing Comment in C we needs to know about some rules that used to write comments:-
Rules :-1 . Program Contain Any number of comments at any place:-
void main(/*Main Function*/)
{
int age; // Variable
printf("Enter Your Age : ");
scanf("%d",/*Type Age*/&age);
printf("Age is %d : ",/*Your age here*/age);
getch()
}
2 . Nested Comments are not allowed. [Comment within Comment are not allowed]
/* This is /*Print Hello */
printf("Hello");
3 . Comments can be split over more than one line.
printf("Hello"); /* This is Comment */
4 . Comments are not Case-Sensitive.
printf("Hello"); /* This is Comment */ /* THIS IS COMMENT */
5 . Single line Comments Starts with ‘//’
printf("Hello");
// This is Single Line Comment
Rules of Writing Comments
Reviewed by ANAND PANDEY
on
7:34:00 AM
Rating:
No comments: