Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int i;
    enum MonthName
    {
    January,February,March,April,May,June,July,August,September,October,November,December
    };
    for (i = February; i <= November; i++)
    cout << i;
    return 0;
    }
    1. 12345678910
    2. 012345678910
    3. 109876543210
    4. Compilation Error
    5. None of these
Correct Option: A

In this program, we are defined the data types as enumerator and printing its value in a order.



Your comments will be displayed only after manual approval.