programming-examples/c-sharp/_Basic/C# Program to Accept the Height of a Person & Categorize as Tall, Dwarf or Average.cs
2019-11-15 12:59:38 +01:00

27 lines
740 B
C#

/*
* C# Program to Accept the Height of a Person & Categorize as
* Tall, Dwarf or Average
*/
using System;
class program
{
public static void Main()
{
float height;
Console.WriteLine("Enter the Height (in centimeters) \n");
height = int.Parse(Console.ReadLine());
if (height < 150.0)
Console.WriteLine("Dwarf \n");
else if ((height >= 150.0) && (height <= 165.0))
Console.WriteLine(" Average Height \n");
else if ((height >= 165.0) && (height <= 195.0))
Console.WriteLine("Taller \n");
else
Console.WriteLine("Abnormal height \n");
}
}
/*
Enter the Height (in centimeters)
165
Average Height