Keywords & Comments

Thanks for Visiting here

Print Friendly and PDF

 Keywords

Keywords are predefined, reserved words used in programming that have special meanings to the compiler. Keywords are part of the syntax and they cannot be used as an identifier.

For example:

int money;


Here, int is a keyword that indicates money is a variable of type int (integer).


A list of 32 keywords in the c language is given below:

C Keywords
autodoubleintstruct
breakelselongswitch
caseenumregistertypedef
charexternreturnunion
continueforsignedvoid
doifstaticwhile
defaultgotosizeofvolatile
constfloatshortunsigned

        

Comments

Comments in C language are used to provide information about lines of code. It is widely used for documenting code. There are 2 types of comments in the C language.


1.Single Line Comments

2.Multi-Line Comments

1)Single Line Comments

Single line comments are represented by double slash \\. Let's see an example of a single line comment in C.


#include<stdio.h>    
int main(){    
    //codesikhe.blogspot.com   
    printf("Hello C");    
return 0;  
}      

Output

Hello C

Even you can place the comment after the statement. For example:


(2) Multi Line Comments

Multi-Line comments are represented by slash asterisk \* ... *\. It can occupy many lines of code, but it can't be nested. Syntax:


/*  
code
to be commented
*/  

Let's see an example of a multi-Line comment in C.


#include<stdio.h>    
int main(){    
    /*printing information  
      Multi-Line Comment*/  
    printf("Hello C");    
return 0;  
}      

Output

Hello C

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Below Post Ad