How to create a simple console base program in C# ?

Asked 07-Sep-2018
Viewed 643 times

1 Answer


0

How to create a simple console base program in C# ?

How to create a simple console base program in C# ?

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {
            float height;
            Console.WriteLine("Enter Your Height (in centimeters) \n");
            height = int.Parse(Console.ReadLine());
            if (height < 150.0)
                Console.WriteLine("Small(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");
        }
    }
}