Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
enum test {
4.
A = 32, B, C
5.
};
6.
int main()
7.
{
8.
cout
Options:
A .  323334
B .  323232
C .  323130
D .  none of the mentioned
Answer: Option A

If we not assigned any value to enum variable means, then the next number to initialized number will 

be allocated to the variable.
Output:
$ g++ enum2.cpp
$ a.out
323334



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers