Data Types


Data type
Range
Bytes
Format Specifiers
unsigned Char
0 to 255
1
%c
char
-128 to +127
1
%c
more than one character
how much size that many bytes
%s
short signed int (or) signed int (or) int
-32,768 to +32,767
2
%d
short unsigned int (or) unsigned int
0 to 65,535
2
%u
long signed int (or) long int
-2147483648 to +2147483647
4
%ld
long unsigned int
0 to 4294967295
4
%lu
float
3.4e-38 to 3.4e+38
4
%f
double
1.7e-308 to 1.7e+308
8
%lf (or) %e
long double
3.4e-4932 to 1.1e+4932
10
%Lf (or) %le


Rules for writing a C Program

1. Usually all the programming statement must be in the lower case letters only.
2. Program execution starts from the main().
3. All the programming statements must be written in between {}.
4. The list of variables are separated by commas.
5. Every statement ends with ;
6. Every function name must be followed by ().
While comparing and assigning a character should be taken in ‘’.
While comparing and assigning a string should be taken in “”.

No comments:

Post a Comment