C is a general-purpose high-level language was originally developed by Dennis M. Ritchie at Bell Labs.

C has used for various functions:

Easy to learn

Structured language

It produces efficient programs

It can handle low-level activities

It can be compiled on a variety of computer platforms

Tokens in C

In C program tokens are either a keyword, an identifier, a constant, a string literal, or a symbol. For example−

printf(“Hello, World! \n”);

Semicolons

Semicolon is a statement terminator. Denoted by “;”.

print f (“hello, world);

Comments

Comments are helping text in C program and they are ignored by the compiler. Start by “/*” and end by “*/”.

Identifiers

Identifier is a name used to identify a variable, function, or any other user-defined item. An identifier starts with a letter A to Z, a to z, or an underscore ‘_’ followed by zero or more letters, underscores, and digits (0 to 9).

The following table provides the details of standard integer types with their storage sizes and value ranges −

Type

Storage size

Value range

char

1 byte

-128 to 127 or 0 to 255

unsigned char

1 byte

0 to 255

signed char

1 byte

-128 to 127

int

2 or 4 bytes

-32,768 to 32,767 or -2,147,483,648 to 2,147,483,647

unsigned int

2 or 4 bytes

0 to 65,535 or 0 to 4,294,967,295

short

2 bytes

-32,768 to 32,767

unsigned short

2 bytes

0 to 65,535

long

4 bytes

-2,147,483,648 to 2,147,483,647

unsigned long

4 bytes

0 to 4,294,967,295

Floating-Point Types

The following table provide the details of standard floating-point types with storage sizes and value ranges and their precision −

Type

Storage size

Value range

Precision

float

4 byte

1.2E-38 to 3.4E+38

6 decimal places

double

8 byte

2.3E-308 to 1.7E+308

15 decimal places

long double

10 byte

3.4E-4932 to 1.1E+4932

19 decimal places

The void Type

The void type specifies that no value is available. It is used in three kinds of situations −

S.N.

Types & Description

1

Function returns as void There are various functions in C which do not return any value or you can say they return void. A function with no return value has the return type as void. For example, void exit (int status);

2

Function arguments as void There are various functions in C which do not accept any parameter. A function with no parameter can accept a void. For example, int rand(void);

3

Pointers to void A pointer of type void * represents the address of an object, but not its type. For example, a memory allocation function void *malloc( size_t size ); returns a pointer to void which can be casted to any data type.

Constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals.