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

0 votes
71 views
Rahul Ahuja asked 07-Sep-2018 in programming by Rahul Ahuja

Any Type of Program

1 Answer

0 votes
Sanat Shukla answered 07-Sep-2018 by Sanat Shukla

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");
        }
    }
}