Data Types


  1. What is the value of p?
    #include 
    using namespace std;
    int main()
    {
    int res;
    bool p = false;
    bool q = true;
    int num0 = 15;
    int num1 = 10;
    res = ((num0 | num1) + (p + q));
    cout << res;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    16


  1. Evaluate the following
    (false && true) || false || true











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    1



  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int k;
    enum Month {
    January = 1, February ,March, April, May, June, July, August, September, October, November, December
    };
    for (k = April; k <= September; k++)
    cout << k;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    None of these

    Correct Option: A

    We are getting the values from April to September and printing its concern number.


  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    void num0 = 15, num1 = 16;
    int num2;
    num2 = num0 + num1;
    cout << num2;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    void will not accept any values to its type.



  1. Identify the incorrect option.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Enumerators are used in order to create our own types whereas macros are textual substitutions.