You need to evaluate the following code segment:

What happens when the code segment is run?
You need to evaluate the following code segment:
What happens when the code segment is run?
When the code segment is run, the double value 2.667 is cast to an integer. In Java, casting a double to an integer truncates the decimal part and keeps the integer part. Therefore, iNum will have a value of 2 after the cast.
Answer is C
true,i checked by running the code myself.====> 2 is the answer.
Answer shoud be 3 as it does round of
Incorrect, casting to int ignores trailing decimal values and results in 2. I checked by running the code myself.
Ya true brother...u r right
Ya true brother...u r right