CSharp examples for Language Basics:Console
Convert string read from console to double
using System;/*from w ww. ja v a 2 s . c o m*/ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { // Decimal input Console.Write("Enter a decimal number: "); string input = Console.ReadLine(); double decimalNumber = Convert.ToDouble(input); // Repeating entered number to the output Console.WriteLine("You have entered number " + decimalNumber); } }