Sunday, July 17, 2011

Constants in C & C++

Constants:-
                 Constants are the values whose value do not change during the program execution, they may be numeric or character.
There are two types of constants

  1. Numeric constants 
  2. Character Constants 
Numeric Constants:- 
                                Numeric constants are of two types, integers and floating point numbers.
Integer Constants:-
                                Integers shows the values that can be counted e.g number of students in the class.
e.g 0, 2343, 21000 e.t.c
Floating Point Constants:- 
                               floating points constants are use to show the value that can be measured.
e.g 34.44 cm , 99 m e.t.c

Character Constants:-
                                                          A character constant is the symbol in the C character set. A character constant can be any symbol from C character set but it should must be enclosed in single quotes e.g  'a'.



No comments:

Post a Comment