BMI is calculated with meters, not centimeters. So you need to convert the HeightCm
to HeightM
. If you don't do this, you get really small number, that is then printed as 0.
double HeightM = HeightCm / 100.0;
BMI = WeightKg / (HeightM * HeightM);
Also, when parsing, use double.Parse
instead of int.Parse
. The way it is right now, you will only parse the number without the decimal part.