Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
double a = 21.09399;
6.
float b = 10.20;
7.
int c ;
8.
c = (int) a;
9.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
double a = 21.09399;
6.
float b = 10.20;
7.
int c ;
8.
c = (int) a;
9.
cout
Answer: Option A
Was this answer helpful ?
In this program, we casted the data type to integer.
Output:
$ g++ con5.cpp
$ a.out
2110
Was this answer helpful ?
Submit Solution