What is constant in c++ with example?



What is constant in c++ with example?..

Answer / Raj Veer Singh

In C++, a constant is a value that cannot be changed during program execution. A constant can be declared as const int myConstant = 42; or const double PI = 3.14159;. Constants help prevent accidental modification of values.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Comment on local and global scope of a variable.

1 Answers  


Show the declaration for a static member variable.

1 Answers  


How many ways can a variable be initialized into in C++?

1 Answers   HCL,


please help to write the code of chess game in c++??????????

1 Answers   NEC,


What are references in c++?

1 Answers  


Is there any function that can skip certain number of characters present in the input stream?

1 Answers  


When is dynamic checking necessary?

1 Answers  


Which programming language should I learn first?

1 Answers  


What are the types of array in c++?

1 Answers  


Write about the stack unwinding?

1 Answers  


C is to C++ as 1 is to a) What the heck b) 2 c) 10

1 Answers  


What is cloning?

1 Answers  


Categories