This article explains about variable, data types, size and range of data types and examples of it in C programming.
Valid
Invalid
John
Value
123
Price$
Delhi
x1
%
group one
T_raise
mark
(area)
ph_value
sum1
25th
distance
int_type
char
Integral type
Integer
Character
Signed Type
Unsigned Type
Signed char
int
unsigned int
unsigned char
Short int
unsigned short
long int
unsigned long
Floating Point Type
float
double
long double
Data Type
Range of Values
char or signed char
-128 to 127
0 to 255
int or signed int
-32768 to 32767
0 to 65536
-2,147483,648 to + ..47
3.4e-38 to 3.4e+38
1.7e-308 to 1.7e+308
data-type v1,v2,…,vn ; examples int count; int number, total; double ratio; char c; long l;
data-type v1,v2,…,vn ;
examples
int count;
int number, total;
double ratio;
char c;
long l;
typedef type identifier
typedef int units; typedef float marks; units batch1, batch2; marks name1[50], name2[50]
typedef int units;
typedef float marks;
units batch1, batch2;
marks name1[50], name2[50]
enum identifier {val1, val2, …,valn}; enum day {Monday, Tuesday, .., Sunday}; enum day week_st, week_end; week_st = Monday; week_end = Friday; if (week_st == Tuesday) week_end = Saturday enum day (Monday=1, Tuesday, ..,Sunday};enum day {Monday, Tuesday, .., Sunday} week_st;
Statement
Validity
Remark
#define X = 25
= sign not allowed
#define M 10
Space not allowed
#define N 25;
; not allowed
#define N 5, M 2
Only one in statement
#Define A 10
D is not valid
#define price$ 4
$ is not permitted