I wanted to write a very basic BMI calculation for showcasing purposes. However the variable bmi is always 0 because the result of the calculation is a decimal bellow 0 (0,18 0,2352) and so on. I tried hardcoding the numbers for the calculation. I changed the variable type from double to float. But nothing changed. I also don't get any errors or warnings from Visual studio. Can anybody help?
static void Main(string[] args)
{
Console.WriteLine("BMI rechner");
double weight;
double height;
string name;
double bmi;
int x = 1;
do{
Console.WriteLine("Bitte gib deinen Namen ein:");
name = Console.ReadLine();
Console.WriteLine("Bitte gib dein Gewicht in kg ein:");
weight = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Bitte gib deine Größe in cm ein:");
height = Convert.ToDouble(Console.ReadLine());
bmi = 60 / (165 * 165);
// bmi = weight / (height * height);
Console.WriteLine("{0}s BMI ist {1}",name,bmi);
Console.WriteLine();
Console.WriteLine("Erneut berechnen(1)? Beenden(0)");
x = Convert.ToInt32(Console.ReadLine());
} while (x == 1);
Console.WriteLine("Vielen dank für das verwenden des BMI rechners.");
Console.ReadLine();
}