Friday, June 29, 2018

C programming basic Syntax




C syntax program is very easy. You will know what is syntax of C programming language. In addition, 

you will know tokens in C language. Even White-space in C programming language has been 

discussed here. You must also remember that you practice C syntax example exercises.


Practice all the exercises here to know syntax of C programming language. Keep reading to know more.


What are tokens in C programming language?



C program has tokens. These tokens can be keyword, string literal and identifier. Even constant and symbol are tokens.


Comments in C program



In C program, comments help text. Moreover, compiler ignores these texts. You must also know how 

these comments start and end. Comments start with /*. While they end with */. You must also 

remember a few more points. Firstly, you cannot write comments in comments. Secondly, they will

 never occur in character or string literals.


What are semicolons in C?


Semicolon is statement terminator in programs that you write in C. It means that all statements will 

end with semicolon. In other words, it is end of logical entity.

C program identifiers


You will use C identifier to identify variable or functions. You can even identify user-defined things.

 In addition, identifiers begin with A to Z or a to z. Plus, underscore ‘_’ can start as identifier. However, 

letters, zero’s or digits (only from 0 to 9) come after identifiers.

Note: 


C will never have punctuation characters. Therefore, in identifiers you will not have $, @, %. Another 

aspect is that C is case sensitive programming language. Hence, Adam and adam are different 

identifiers in C.

Keywords in C



In C, you can check reserved keywords. These reserved keywords will not use as variables, constants or other identifier names.




List of keywords in C programming language


constforsignedvoid
dointstruct_Packed
breakenumregistertypedef
caseexternreturnunion
autoelselongswitch
charfloatshortunsigned
defaultifstaticwhile
doublegotosizeofcontinue
volatile





Whitespace in C programming language


C compiler ignores blank line. This line has whitespace. And there can be a comment there. There are

 C whitespace rules. These rules apply to C whitespace characters. In addition, in C whitespace

 means blanks, newline characters, tabs or even comments. This whitespace character function will

 separate statements.


Therefore, compiler identifies element in statements. C whitespace characters copy should be there.

 This has to be between int and age. In this way compiler will differentiate them. Finally, C

 whitespace code will increase readability.

































No comments:

Post a Comment