#include <iostream> using namespace std; enum test { A = 32, B, C }; int main() { cout << A << B<< C; return 0; }
a) 323334
b) 323232
c) 323130
d) 323134
#include <iostream> using namespace std; enum test { A = 32, B, C }; int main() { cout << A << B<< C; return 0; }
a) 323334
b) 323232
c) 323130
d) 323134
You must be logged in to post a comment.
a
Explanation: 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