say i have 3 numbers, all 3 are ints... such as x = 1, y = 2, z = 3
and i want to calculate the average of the ints by performinag FLOATing point division...
could i just set a variable like
float average;
and then do float = (1+2+4)/3 and have the result be the average in a float type? that doesn't seem to work...would i have to take in the 3 variables as float and not int to do that?
thanks!
and i want to calculate the average of the ints by performinag FLOATing point division...
could i just set a variable like
float average;
and then do float = (1+2+4)/3 and have the result be the average in a float type? that doesn't seem to work...would i have to take in the 3 variables as float and not int to do that?
thanks!