Thursday, September 23, 2010

Declaring a Variable in C


The basic syntax for declaring a variable in C is 

                                datatype variablename
Datatype stands for the type of data of the variable it can be an integer,floating point value ,character etc.


The basic thing to understand is datatype specifies the the type of your variable whether it is a number,name or any other type of data.
                                                                                     

The primary data types in C are                                                     

1.

Integer

int

2.

Character

char

3.

Floating Point

float

4.

Double precision floating point

double

5.

Void

void


The range of values which these data types can take are given below in the table

Datatype

Range

char

-128 to 127

Int

-32768 to +32767

float

3.4 e-38 to 3.4 e+38

double

1.7 e-308 to 1.7 e+308



1 comments:

Post a Comment

Subscribe

The Source Codes Published in this Blog can be used freely for Educational purposes but should not be reproduced on any other Blog or Website without the consent of the author.