Question
1.
#include
2.
using namespace std;
3.
enum cat {
4.
temp = 7
5.
};
6.
int main()
7.
{
8.
int age = 14;
9.
age /= temp;
10.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
enum cat {
4.
temp = 7
5.
};
6.
int main()
7.
{
8.
int age = 14;
9.
age /= temp;
10.
cout
Answer: Option B
Was this answer helpful ?
The age will be divided by using compound assignment operator and so it will return the age of the
cat according to your age.
$ g++ enum1.cpp
$ a.out
If you were cat, you would be 2
Was this answer helpful ?
More Questions on This Topic :
Question 5.
Identify the incorrect option.
....
Submit Solution