Computer Science, asked by Anonymous, 7 months ago

The following constants are of which type? in C++
(1)39
(2)032
(3)0XCAFE
(4)04.14

ANSWERS
1)Integer decimal constant
2)Integer octal constant
3)Integer Hexadecimal constant
4)Real constant

Thank you for all your Answers. I have found the answers as mentioned above..​

Answers

Answered by rajeshshingankuli
1

Answer:

An integer constant is a decimal (base 10), octal (base 8), or hexadecimal (base 16) number that represents an integral value. Use integer constants to represent integer values that cannot be changed.

Syntax

integer-constant:

decimal-constant integer-suffixopt

octal-constant integer-suffixopt

hexadecimal-constant integer-suffixopt

decimal-constant:

nonzero-digit

decimal-constant digit

octal-constant:

0

octal-constant octal-digit

hexadecimal-constant:

hexadecimal-prefix hexadecimal-digit

hexadecimal-constant hexadecimal-digit

hexadecimal-prefix: one of

0x 0X

nonzero-digit: one of

1 2 3 4 5 6 7 8 9

octal-digit: one of

0 1 2 3 4 5 6 7

hexadecimal-digit: one of

0 1 2 3 4 5 6 7 8 9

a b c d e f

A B C D E F

integer-suffix:

unsigned-suffix long-suffixopt

unsigned-suffix long-long-suffix

unsigned-suffix 64-bit-integer-suffix

long-suffix unsigned-suffixopt

long-long-suffix unsigned-suffixopt

64-bit-integer-suffix

Similar questions