The type of data that
can be processed through the programming language 'C' are classified as follows
Non Numeric literals:
Literal
A literal is a value that is used in the program.
A literal is a value that is used in the program.
Numeric literals:
All numeric literals should not contains any
special characters or space.
It can be positive or negative.
Decimal
·
A decimal literal should start with numbers
other than ‘0’
·
It should contain only numbers
Eg:- 1234 , +248, -198
Wrong:- 03230
Hexa-Decimals
·
Should start with ‘0x’
·
Should contain only hexa decimal numbers ( 0 -9,
A,B, C,D,E,F)
Eg:- 0x1234, +0xFACE, -0x23BAD
Wrong: 0xHEAD
Wrong: 0xHEAD
Octal
·
Should start with ‘0’
·
Should
contain only Octal numbers (0-7)
Eg: - 0123, +0777, -0674
Wrong: 0896, 08AB, 0128
Real literals
·
Should contain only numbers and one decimal
point.
Non numeric constant is of two type i) character ii) escape characters iii) String
Character:-
The character literal are
expressed with in a single quotation in ‘C’ language. Only one character is
allowed within the quotation. The character can be any ascii character.
Eg:- ‘A’, ‘a’, ‘+’, ‘.’, ‘1’,
Wrong: ‘abc’, ‘1.0’

No comments:
Post a Comment