Professional Documents
Culture Documents
Constants
Numeric Character
Constants Constants
Numeric constants, as the name itself indicates, are those which consist of
numerals. They are further divided into two types:
Integer Constant
• They are decimal constants (base 10), Octal constants (base 8) and
hexadecimal constants (base 16).
Rules
• (vi) The value of constant must not exceed specified minimum and
maximum bound.
Decimal Integer
• If the constant consists of two or more digits, the first digit must be other
than 0.
• Valid example
Octal Integer
• However the first digit must be 0, in order to identify the constant as an octal
number.
• 00 06 0753 0663
Real constant
• Use of blank space and comma is not allowed between real constants.
Exponential form
• The part of the number appearing before the alphabet e is the mantissa and
the part following e is the exponent.
• mantissa e exponent
• The mantissa can be positive or negative with the default sign of the
mantissa being positive.
• - The exponent should have atleast one digit which is a positive or negative
integer.
String Constant :
“Hello”
“WELL DONE”
Constants Name
\a Alert (bell)
\b Backspace
\f Form feed
\n New line
\r Carriage returns
\t Horizontal tab
\v Vertical tab
\’ Apostrophe
\” Double quote
\? Question mark
\\ Backslash
\0 Null character