I am trying to create a function that displays the Height of a person according to the user input, either short, average, or tall. If the user enters something else, displays "Abnormal" The problem here is that I'm only getting Abnormal as a result for all input.
using System;
public class program
{
public static void Main()
{
int a;
Console.WriteLine("Enter the Height: ");
a = Convert.ToInt32(Console.ReadLine());
switch (a)
{
case 1:
if (a < 150)
Console.WriteLine("Short");
break;
case 2:
if ((a >= 150) && (a <= 165))
Console.WriteLine("Average");
break;
case 3:
if ((a >= 166) && (a <= 195))
Console.WriteLine("Tall");
break;
default:
Console.WriteLine("Abnormal");
break;
}
}
}