Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int i;
6.
enum month {
7.
JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,DEC
8.
};
9.
for (i = JAN; i
Options:
A .  012345678910
B .  0123456789
C .  01234567891011
D .  none of the mentioned
Answer: Option A

In this program, we are defined the data types as enumerator and printing its value in a order.
Output:
$ g++ user1.cpp
$ a.out
012345678910



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers