Constants/Literals


  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int const num = 10;
    cout << ++num;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    We cannot modify a constant integer value.


  1. How are the constants declared?











  1. 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.



  1. What are the parts of the literal constants?











  1. 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.


  1. The constants are also called as











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    literals