Integer constant ? How many types of integer constants
Answers
Integer Constants
. Integer constants are used to represent whole numbers. An integer constant can be specified in decimal, octal, or hexadecimal radix, and can optionally include a prefix that specifies its radix and a suffix that specifies its type. An integer constant cannot include a period or an exponent part
type of integer constant
numeric,integer,real,character,string
....
Integer Constants. Integer constants are used to represent whole numbers. An integer constant can be specified in decimal, octal, or hexadecimal radix, and can optionally include a prefix that specifies its radix and a suffix that specifies its type. An integer constant cannot include a period or an exponent part ...
Integer constants are used to represent whole numbers. An integer constant can be specified in decimal, octal, or hexadecimal radix, and can optionally include a prefix that specifies its radix and a suffix that specifies its type. An integer constant cannot include a period or an exponent part.
Follow these rules when specifying an integer constant:
To specify a decimal integer constant, use a sequence of decimal digits in which the first digit is not 0. The value of a decimal constant is computed in base 10.
To specify an octal integer constant, start the sequence with a zero (0) and follow the 0 (if necessary) with a sequence composed of the digits 0 to 7. A leading 0 alone signifies the octal number 0. The value of an octal constant is computed in base 8.
To specify a hexadecimal integer constant, start the hexadecimal sequence with a 0 followed by the character X (or x ). Follow the X or x with one or more hexadecimal characters (the digits 0 to 9 and the upper or lowercase letters A to F). The value of a hexadecimal constant is computed in base 16 (the letters A to F have the values 10 to 15, respectively).
Without explicit specification, the type of an integer constant defaults to the smallest possible type that can hold the constant's value, unless the value is suffixed with an L , l , U , or u .