visual studio - Need help with accepting decimals as input in C# -
I wrote a program in C # running Pythagorean theorem. I have some help if I would like some help on allowing the program to accept decimal numbers from user input.
using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; Namespace project_2 {class program {static zero main (string [] args) {int sideA = 0; Int sideB = 0; Double side c = 0; Console Write ("Enter an integer for side A"); Side A = Convert ToInt16 (Console.Readline ()); Console Write ("Enter an integer for side b"); Sideb = convert.ToInt16 (console .readline ()); Side C = Math Po ((SaidA * Side A + Sidebie * Sidebie), .5); Console Write ("This is the length in side c ..."); Console.WriteLine (sideC); Console.ReadLine (); }}} I Math it Trying to do research using the abus and likewise to get build errors only. Help in Written Path will be greatly appreciated.
I recommend using decimal. Trips This pattern is very safe because it enters exceptions and gives a boolean to determine the success of the pars operation.
Comments
Post a Comment