Constants
Types of C constant:
Constant type
|
data type (Example)
|
Integer constants | int (53, 762, -478 etc ) unsigned int (5000u, 1000U etc) long int, long long int (483,647 2,147,483,680) |
Real or Floating point constants | float (10.456789) doule (600.123456789) |
Octal constant | int (Example: 013 /*starts with 0 */) |
Hexadecimal constant | int (Example: 0x90 /*starts with 0x*/) |
character constants |
char (Example: ‘A’, ‘B’, ‘C’)
|
string constants |
char (Example: “ABCD”, “Hai”)
|
Backslash_character | Meaning |
\b | Backspace |
\f | Form feed |
\n | New line |
\r | Carriage return |
\t | Horizontal tab |
\” | Double quote |
\’ | Single quote |
\\ | Backslash |
\v | Vertical tab |
\a | Alert or bell |
\? | Question mark |
\N | Octal constant (N is an octal constant) |
\XN | Hexadecimal constant (N – hex.dcml cnst) |
HYPER ERA PVT.LTD | TERMS & CONDITIONS