Professional Documents
Culture Documents
Data Types, Variables & Keywords
Data Types, Variables & Keywords
Lecture 02
D a t a t y p e s , Va r i a b l e s & O p e r a t o r s
o C data types are defined as the data storage format that a variable can store a data to perform a
specific operation.
o Data types are used to define a variable before to use in a program.
o Size of variable, constant and array are determined by data types.
1.float:
Float data type allows a variable to store decimal values.
We can use up-to 6 digits after decimal using float data type.
For example, 10.456789 can be stored in a variable using float data type.
2.double:
Double data type is also same as float data type which allows up-to 10 digits after decimal.
The range for double data type is from 1E–37 to 1E+37.
Array, pointer, structure and union are called derived data type in C language.
To know more about derived data types, please read “C – Array“ ,“C – Pointer” ,“C –
Structure” and “C – Union” topics from book.
4.0 Void data type inC:
2 Variable initialization data_type variable_name = value; int x = 50, y = 30; char flag = ‘x’,ch=’l’;
A header file is a file containing C declarations to be shared between several source files.
You request the use of a header file in your program by including it, with the C preprocessing
directive ‘#include’.
o System header files declare the interfaces to parts of the operating system.
o You include them in your program to supply the definitions and declarations you need to invoke
system calls and libraries.
o Your own header files contain declarations for interfaces between the source files of your
program.
<conio.h> definition: conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output. It is
not part of the C standard library, ISO C nor is it defined by POSIX.This header declares several useful library
functions for performing "console input and output" from a program.