Data Types
- In which type do the enumerators are stored by the compiler?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
integer
- To which of these enumerators can be assigned?
-
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.
- What will happen when defining the enumerated type?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Enumerator will allocate the memory when its variables are defined.
- Which variable does equals in size with enum variable?
-
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.
- 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;
}
-
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.