Resultant type of the following expression bh – i + db / fl – i * fl + db / i, (int) ( fl + db )

Q30. What will be the resultant type of the following expression is if bh represents a byte variable, i is an int variable, fl is a float variable and db is a double variable?

  1. bh – i + db / fl – i * fl + db / i
  2. (int) ( fl + db )

Ans.

  1. bh – i + db / fl – i * fl + db / i

resultant type of above expression will be double

2. (int) ( fl + db )

resultant type of above expression will be int

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: