Understanding C Language vs. English Language: A Comparative Analysis
Table of Content:
To talk to someone you need to know a language that both of you and your friend should know. then, you express your feelings, pondering over every word that you say, so that it makes some sense. similarly, programming is talking to a computer using a computer language.
We use a language called English to convey something to someone. With the help of writing or speaking.
Similarly, a Programming language is the language used for programming. Programming is, in turn, the task of writing a program. And the program is a set of logically connected statements that solve a problem.
The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are combined to form sentences and sentences are combined to form paragraphs. Learning C is similar and easier.
Instead of straight-away learning how to write programs, we must first know what alphabets, numbers and special symbols are used in C, then how using them constants, variables, and keywords are constructed, and finally how are these combined to form an instruction? A group of instructions would be combined later on to form a program.
The C Character Set
Character:It denotes any alphabet, digit or special symbol used to represent information.
Use of Character:
Characters can be combined to form variables. C uses constants, variables, operators, keywords and expressions as building blocks to form a basic C program.
Character Set:
The character set is the fundamental raw material of any language and they are used to represent information. Like natural languages, computer language will also have a well-defined character set, which is useful to build the programs.
Whenever we write any C program then it consists of different statements. Each C Program is set of statements and each statement is set of different c programming lexims. In C Programming each and every character is considered as single lexim. i.e [ Basic Lexical Element ]
The characters in C are grouped into the following two categories:
A. Source character set
- Alphabet
- Digits
- Special Characters
- White Spaces
B. Execution character set
- Escape Sequence
Names | Symbols |
Alphabets | A, B, ….., Y, Z a, b, ……, y, z |
Digits | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 |
Special symbols | ~ ‘ ! @ # % ^ & * ( ) _ - + = | \ { } [ ] : ; " ' < > , . ? / |
White Spaces | Tab Or New line Or Space |
Valid C Characters : Special Characters are listed below –
Symbol | Meaning |
---|---|
~ | Tilde |
! | Exclamation mark |
# | Number sign |
$ | Dollar sign |
% | Percent sign |
^ | Caret |
& | Ampersand |
* | Asterisk |
( | Left parenthesis |
) | Right parenthesis |
_ | Underscore |
+ | Plus sign |
| | Vertical bar |
\ | Backslash |
` | Apostrophe |
– | Minus sign |
= | Equal to sign |
{ | Left brace |
} | Right brace |
[ | Left bracket |
] | Right bracket |
: | Colon |
” | Quotation mark |
; | Semicolon |
< | Opening angle bracket |
> | Closing angle bracket |
? | Question mark |
, | Comma |
. | Period |
/ | Slash |
Special Backslash Character Constants in C :
Constant | Meaning |
---|---|
‘a’ | Audible Alert (Bell) |
‘b’ | Back Space |
‘f’ | Form Feed |
‘n’ | New Line |
‘r’ | Carriage Return |
‘t’ | Horizontal Tab |
‘v’ | Vertical Tab |
”’ | Single Quote |
‘”‘ | Double Quote |
‘?’ | Question Mark |
‘\’ | Backslash |
‘\0’ | Null |