Saturday, August 14, 2010

Constants

,
Definition Of Constant:-The constants in C and C++ are applicable to the values ,which do not change during the execution of a program.
There are a several type of constants in C and C++.They are Claasified into various categories are as follows:-
1.)Integer Constant
2.)Real Constant
3.)Character Constant
4.)String Constant

1.)Integer constant:-Integer constants are those who provide the numbers are either positive or negative.
Example:-const int a=5;

2.)Real Constant:-The real constants can be written in exponential notation,which contains a fractional part and an exponential part.
Example:-Const float=3.4;

3.)Character Constant:-A character constant is a single character constant.A digit,alpahabets,white space enclosed with a pair of single quote marks.
Example:-Const char ch='a';

4.)String Constants:-A String constant is a collection of characters enclosed with a pair of double quote marks.
Example:-"Anusha";







0 comments to “Constants”

Post a Comment