A

Admin • 828.03K Points
Coach

Q. What will be output for the following code?

Code:
#include<stdio.h>
int main()
{
double x = 1.2;
int sum = (int)x + 1;

printf(""sum = %d"", sum);

return 0;
}
  • (A) sum = 0
  • (B) sum = 1
  • (C) sum = 2
  • (D) sum = 3
  • Correct Answer - Option(C)
  • Views: 8
  • Filed under category C Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.