Read double from keyboard and parse it : double parse « Data Type « C# / CSharp Tutorial






using System;  
  
class MainClass {     
  public static void Main() {     
    double s1; 
    string str; 
 
    Console.WriteLine("Enter length of first side: "); 
    str = Console.ReadLine(); 
    s1 = Double.Parse(str); 
 
  }     
}
Enter length of first side:
12








2.29.double parse
2.29.1.Parsing strings to create data types: double
2.29.2.Parse Double with Exception handling
2.29.3.Read double from keyboard and parse it
2.29.4.Read double from console and do the calculation
2.29.5.Attempting to parse the string representation of either MinValue or MaxValue throws an OverflowException