Constants/Literals
- What is the output of this program?
#include
using namespace std;
int main()
{
int const num = 10;
cout << ++num;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
We cannot modify a constant integer value.
- How are the constants declared?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The const will declare with a specific type value and #define is used to declare user-defined constants.
- What are the parts of the literal constants?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Because these are the types used to declare variables and so these can be declared as constants.
- The constants are also called as
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
literals