+ 2
Someone please explain the output of this code. It is giving output different what i expected
2 Réponses
+ 2
I guess that the erratic behavior comes from the fact that your number you try to cast is too big to be stored as an integer. The program then outputs the biggest integer it knows.
+ 1
Type Casting means - Converting one data type into another...
-
As an example,
Pi = 3.1416 (it's in float or double data type)
after type casting it into (integer), the output will be:
Pi = 3 (only 3, cause we type casted it into integer)
-
Hope, you understood! 😊