Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int num1 = 10;
6.
float num2 = 20;
7.
cout
What is the output of the following program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int num1 = 10;
6.
float num2 = 20;
7.
cout
Answer: Option B
Was this answer helpful ?
In this program, integer is converted into float. Therefore the result of num1 and num2 is float. And it
is returning the size of the float.
Output:
$ g++ size2.cpp
$ a.out
4
Was this answer helpful ?
More Questions on This Topic :
Question 3.
Identify the incorrect option.
....
Submit Solution