Casting an integer to a float effectively changes the data type of the stored value from an int to a foat. Whereas the integer 5 is represented in the computer’s memory using binary 2’s complement for example, when you write (float)5 this resulting number is stored as mantissa and exponent in the way we just learned.
Does the datatype of a variable change when you cast or is it just the number itself that is stored differently inside the computer? For example, if \(a\) and \(b\) are variables of type int, where a has the value 12, b has the value 4, what is the data type of the variable a after the operation ((float)a+b)/3 is performed?