Data Types


  1. In which type do the enumerators are stored by the compiler?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    integer


  1. To which of these enumerators can be assigned?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Since enumerators evaluate to integers, and integers can be assigned to enumerators, enumerators can be assigned to other enumerators.



  1. What will happen when defining the enumerated type?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Enumerator will allocate the memory when its variables are defined.


  1. Which variable does equals in size with enum variable?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The enum variable is converted to an integer and stored by the compiler. So both are equal in size.



  1. What is the output of this program?
    #include 
    using namespace std;
    enum boy
    {
    num = 20
    };
    int main()
    {
    int age = 100;
    age /= num;
    cout << "If you were boy, you would be " << age << endl;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The age will be divided by using compound assignment operator and so it will return the age of the boy according to your age.