Write a short note on the const keyword with an example.
Advertisements
Question
Write a short note on the const keyword with an example.
One Line Answer
Advertisements
Solution
const is the keyword used to declare a constant, const keyword modifies/restricts the accessibility of a variable. So, it is known as an Access modifier.
shaalaa.com
Lexical Units (Tokens)
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
Which of the following statements is not true?
Which of the following is called compile-time operators?
Can keywords be used as identifiers?
The following constant is of which type?
032
The following constant is of which type?
0XCAFE
The following constant is of which type?
04.14
Match the following.
| A | B |
| (a) Modulus | (1) Tokens |
| (b) Separators | (2) Remainder of a division |
| (c) Stream extraction | (3) Punctuators |
| (d) Lexical Units | (4) get from |
What is the difference between 56L and 56?
Determine which of the following are valid constant? And specify their type.
0.5
What are arithmetic operators in C++? Differentiate unary and binary arithmetic operators. Give example for each of them.
