class Integer
{
int num;
public:
num =
]
Integer ()
{
0;
cout << "1";
}
Integer (int arg)
{
cout << "2";
num =
arg;
}
int getValue()
{
cout << "3";
return num;
}
w
};
int main()
{
Integer i;
i = 10;
cout << i.getValue();
return 0;
}
Answers
Answered by
3
Answer:
Input : n = 6
Output : 2
Binary representation of 6 is 110 and has 2 set bits
Input : n = 13
Output : 3
Binary representation of 13 is 1101 and has 3 set bits
setbit
Answered by
0
The output of this program will be a compiler time error.
- There are a lot of errors in the given C++ code.
- First of all no header file is included in this program, the standard input-output file that is the stdio header file must be included in this program.
- Then there are a lot of syntax errors in the given code, the num variable is not assigned any value, and neither the type of variable is mentioned.
- The braces used while defining a class are {}, but square braces [] are used.
#SPJ2
Similar questions