Home » C++ Programming » Data Types » Question
  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. 456789
    2. 0123456789101112
    3. 0123456
    4. 89101112
    5. Compilation Error
Correct Option: A

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



Your comments will be displayed only after manual approval.