Sponsored Links
C Language Tutorials
- TSR in C - An Introduction
- Concept of Pixel in C Graphics
- Call by Value and Call by Reference
- C Language - The Preprocessor
- C Programming - File management in C
- C Programming - Linked Lists
- C Programming - Dynamic Memory allocation
- C Programming - Pointers
- C Programming - Structures and Unions
- C Programming - Functions (Part-II)
- C Programming - Functions (Part-I)
- C Programming - Handling of character string
- C Programming - Arrays
- C Programming - Decision Making - Looping
- C Programming - Decision Making - Branching
- C Programming - Managing Input and Output Operations
- C Programming - Expressions
- C Programming - Operators
- C Programming - An Overview
- C Programming - Constants and Variables
Tutorials
C LanguageC Programming - Constants and Variables
Table of Contents
C Programming - Constants and Variables
C Programming - Constants and Variables - Page 2
C Programming - Constants and Variables - Page 3C Programming - Constants and Variables
C Programming Language - Constants and Variables
In this tutorial you will learn about Character Set, C Character-Set Table, Special Characters, White Space, Keywords and Identifiers, Constants, Integer Constants, Decimal Integers, Octal Integers, Hexadecimal integer, Real Constants, Single Character Constants, String Constants, Backslash Character Constants [Escape Sequences] and Variables.
Instructions in C language are formed using syntax and keywords. It is necessary to strictly follow C language Syntax rules. Any instructions that mis-matches with C language Syntax generates an error while compiling the program. All programs must confirm to rules pre-defined in C Language. Keywords as special words which are exclusively used by C language, each keyword has its own meaning and relevance hence, Keywords should not be used either as Variable or Constant names.
Character Set
The character set in C Language can be grouped into the following categories.
1. Letters
2. Digits
3. Special Characters
4. White Spaces
White Spaces are ignored by the compiler until they are a part of string constant. White Space may be used to separate words, but are strictly prohibited while using between characters of keywords or identifiers.
C Character-Set Table
|
Letters |
Digits |
|
Upper Case A to Z |
0 to 9 |
|
Lower Case a to z |
. |
Special Characters
|
, |
.Comma |
& |
.Ampersand |
|
. |
.Period |
^ |
.Caret |
|
; |
.Semicolon |
* |
.Asterisk |
|
: |
.Colon |
- |
.Minus Sign |
|
? |
.Question Mark |
+ |
.Plus Sign |
|
' |
.Aphostrophe |
< |
.Opening Angle (Less than sign) |
|
" |
.Quotation Marks |
> |
.Closing Angle (Greater than sign) |
|
! |
.Exclaimation Mark |
( |
.Left Parenthesis |
|
| |
.Vertical Bar |
) |
.Right Parenthesis |
|
/ |
.Slash |
[ |
.Left Bracket |
|
\ |
.Backslash |
] |
.Right Bracket |
|
~ |
.Tilde |
{ |
.Left Brace |
|
- |
.Underscore |
} |
.Right Bracket |
|
$ |
.Dollar Sign |
# |
.Number Sign |
|
% |
.Percentage Sign | . | . |
.
.
.
White Space
1. Blank Space
2. Horizontal Tab
3. Carriage Return
4. New Line
5. Form Feed
Keywords and Identifiers
Every word in C language is a keyword or an identifier. Keywords in C language cannot be used as a variable name. They are specifically used by the compiler for its own purpose and they serve as building blocks of a c program.
The following are the Keyword set of C language.
| .auto | .else | .register | .union |
| .break | .enum | .return | .unsigned |
| .case | .extern | .short | .void |
| .char | .float | .signed | .volatile |
| .const | .for | .size of | .while |
| .continue | .goto | .static | . |
| .default | .if | .struct | . |
| .do | .int | .switch | . |
| .double | .long | .typedef | . |
some compilers may have additional keywords listed in C manual.
Identifiers refers to the name of user-defined variables, array and functions. A variable should be essentially a sequence of letters and or digits and the variable name should begin with a character.
Both uppercase and lowercase letters are permitted. The underscore character is also permitted in identifiers.
Comments
Amit Anjan said:
| ;)hey the content is superb..its too good for the beginners.. |
Thilina said:
|
I really think all this is so incredible coz it is so simple to understand. Now i can bunk classes but still have hope. Thanks |
Aaj said:
|
Hi, i am beginner and want more explanation,please provide |
preeti said:
| the content is fabulus |
lalu said:
|
i would like to know how to produce a new product by using c progrmming and vectors and matrices |
satheesh.s said:
| hai, i am satheesh ,i am doing mca,these simply enough for beginners ,i want to know the source code for printf and scanf fuctions. |
Raman Bhatia said:
| Hi, This is Raman Bhatia From Punjab , its contents too simple that i want to appriciate to the Writer, its too fabulous |
Anuj said:
| I really think all this is so incredible coz it is so simple to understand. Now i can bunk classes but still have hope. |
Sonu Bhadouria said:
| Its very necessery for the beginner. |
bharathi said:
| i need help to find error |
murari said:
| hey it is quite interesting for the those who want to learn C programming from the begaining.I would like to know the difference between structure and function in C programming |
murari said:
|
I really have interest for learning the C programming. When the function portion comes, I really confuse. How I can remove it. thank u |
Sponsored Links
