Each variable has an associated data type in C programming. C language supports both signed and unsigned literals and requires different amounts of memory.
| Type Specifier | Description |
|---|---|
| int | Stores an integer number |
| long int | Stores a long integer numbers |
| unsigned int | Stores an unsigned integer numbers |
| char | Store a character |
| unsigned char | Store a unsigned character |
| float | Stores a floating number |
| Double | Stores a double floating number |
| long double | Stores a long double floating number |
Variable is a location in computer memory where data is temporary stored OR saved.
How to use
e.g: int RollNumber = 13;
| int | is Data Type of variable |
|---|---|
| RollNumber | is Name of variable |
| 13 | is Value of variable |
e.g: float floatingVariable = 5.67;
| float | is Data Type of variable |
|---|---|
| floatingVariable | is Name of variable |
| 5.67 | is Value of variable |
int MyVariable;
MyVariable = 56;
Variable Initialization:
int MyVariable = 56;
| Specifier | Use |
|---|---|
| %c | character |
| %u | unsigned decimal |
| %n | Nothing printed |
| %d | decimal |
| %f | floating number |
| %i | integer |
| %X | Unsigned hexadecimal |
| %p | Pointer address |
| %o | Octal number |
| %s | string |
| Characters | Use for |
|---|---|
| \t | Tab |
| \v | Vertical tab |
| \b | Backspace |
| \n | Goto new line |
| \\ | Backslash |
| \a | Audible alert |
| \f | form feed |
| \r | Carriage return |