Data Types


  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int p = 15;
    if (p < 13) {
    for (k = 0; k < 12; k++)
    cout << k;
    }
    else {
    cout << k;
    }
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In function 'int main()':
    7:18: error: 'k' was not declared in this scope
    11:21: error: 'k' was not declared in this scope


  1. Identify the incorrect statements.
     int num = 23;
    Statement (i): int *ptr = &(num + 2);
    Statement (ii): int *ptr2 = #
    Statement (iii): &&num = 50;











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In statement (i) value is required as unary ‘&’ operand and in statement (iii) value is required as left operand.



  1. The operator used for dereferencing or indirection is ____











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    *


  1. It is guaranteed that a ____ has at least 8 bits and a ____ has at least 16 bits.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    char, short



  1. What is the range of the floating point numbers?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    -3.4E+38 to +3.4E+38