Key words
keywords are the predefined and we cannot be change, this are all giving special meanings to the compilerall keywords must be returned in lowercase
This key can't used as a Indentifiersin the program.
Keyword | Description |
---|---|
auto | Declare automatic variable |
break | Exit from loop or switch statement |
case | Label for a case in a switch statement |
char | Character data type |
const | Declare read-only variable |
continue | Continue to the next iteration of a loop |
default | Label for the default case in a switch statement |
do | Start a do...while loop |
double | Double-precision floating-point data type |
else | Execute an alternative statement in an if...else statement |
enum | Declare an enumeration |
extern | Declare an external variable or function |
float | Single-precision floating-point data type |
for | Start a for loop |
goto | Jump to a labeled statement |
if | Conditional statement |
int | Integer data type |
long | Long integer data type |
register | Declare a register variable |
return | Return a value from a function |
short | Short integer data type |
signed | Declare a signed variable |
sizeof | Size in bytes of a data type or object |
static | Declare a static variable or function |
struct | Declare a structure |
switch | Start a switch statement |
typedef | Define a new data type |
union | Declare a union |
unsigned | Declare an unsigned variable |
void | Void data type |
volatile | Declare a volatile variable |
while | Start a while loop |
Indentifiers
identify a reference to the name of function, variable and arrays. These are all user-defined types
Here is the simple example using int :-
Ruls of assiging identifier
- Cannot use a keyword as a identifier
- Its begin with a alphabet/ underscore (_)
- Not contain white space
- Consists of only letters, digits, underscore
Example
#include <stdio.h> int main() { //age is an identifier for a variable of type int int age; // Assign the value 25 to the 'age'variable age = 27; printf("My age is %d years.\n", age); return 0; }
OutPut
My age is 27 years.