CPP

CPP

Constants has 5 Questions
The constants are also called as

const
preprocessor
literals
none of the mentioned
What are the parts of the literal constants?

integer numerals
floating-point numerals
strings and boolean values
all of the mentioned
How the constants are declared?

const keyword
#define preprocessor
both a and b
None of the mentioned

What is the output of this program?

  1.     #include <iostream>
  2.     using namespace std;
  3.     int main()
  4.     {
  5.         int  const  p = 5;
  6.         cout << ++p;
  7.         return 0;
  8.     }


5
6
Error
None of the mentioned
What is the output of this program?
  1.     #include <iostream>
  2.     using namespace std;
  3.     #define PI 3.14159
  4.     int main ()
  5.     {
  6.         float r = 2;
  7.         float circle;
  8.         circle = 2 * PI * r;
  9.         cout << circle;
  10.         return 0;
  11.     }

12.5664
13.5664
10
compile time error