Top

Discussion

What will be the output of the following C++ code?

#include 
    using namespace std;
    int main()
    {
        int  const  p = 5;
        cout << ++p;
        return 0;
    }

 

  • A.5
  • B.6
  • C.Error
  • D.8

Answer: C

We cannot modify a constant integer value.

No comment is present. Be the first to comment.
Loading…

Post your comment