Advertisements
Advertisements
Question
Write a short note on the const keyword with an example.
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.
APPEARS IN
RELATED QUESTIONS
Which of the following statements is not true?
The following constant is of which type?
032
The following constant is of which type?
0XCAFE
Write the following real constant into the exponent form:
23.197
Write the following real constant into the exponent form:
7.214
Assume n = 10; what will be result of n++ and --n;?
Is C++ case sensitive? What is meant by the term “case sensitive”?
Consider the following C++ statement. Are they equivalent?
char ch = 67;
char ch = ‘C’;
Determine which of the following are valid constant? And specify their type.
‘\t’
What are arithmetic operators in C++? Differentiate unary and binary arithmetic operators. Give example for each of them.
