posted 23 years ago
I was writing a program that displayed the sum, product, average, smallest and largest values of three integers. In order to get the smallest and largest, I used if statements. The compiler wanted the variables "smallest & largest" in the if statements to be initialized, but it didn't fuss about the variables "average, sum, and product." Why is it that variables in if statements must be initialized, but when performing regular calculations the compiler doesn't care?