Home » C++ Programming » Data Types » Question
  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. If you were boy, you would be 5
    2. If you were boy, you would be 0
    3. If you were boy, you would be 10
    4. All of above
    5. None of these
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.



Your comments will be displayed only after manual approval.