Question
1.
#include
2.
using namespace std;
3.
main()
4.
{
5.
double a = 21.09399;
6.
float b = 10.20;
7.
int c ,d;
8.
c = (int) a;
9.
d = (int) b;
10.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
main()
4.
{
5.
double a = 21.09399;
6.
float b = 10.20;
7.
int c ,d;
8.
c = (int) a;
9.
d = (int) b;
10.
cout
Answer: Option C
Was this answer helpful ?
In this program, we are casting the operator to integer, So it is printing as 21 and 10
Output:
$ g++ op5.cpp
$ a.out
21 10
Was this answer helpful ?
More Questions on This Topic :
Question 5.
What is the use of dynamic_cast operator?
....
Question 8.
What is this operator called ?: ?
....
Submit Solution