Q.

What is the output of the following code?
int main()
{
double x = 1.2;
int sum = (int) x + 1;
printf("sum=%d", sum);
return 0;
}

A. 2.2
B. 2
C. 2
D. conversion from double to int is not possible
Answer» B. 2
729
0
Do you find this helpful?
5

Discussion

No comments yet

Related MCQs