Learn how type widening works when using float
Using Float: The below statement declares a float and a double as x and y initialized to 3.4f and 5.1d respectively. float x = 3.4f; double y = 5.1d; However, when we try to perform an addition operation, such as given below, we …