c# - Read user input from console -


I want a number from the user who is multiple with Pi number along with the number. I tried something like the one below but it has an effect in a for example, if I include 22 , it would contain 50 is.

  Double A, B; A = console Read (); B = A * Monastery PI; Console.WriteLine (b);  

I'm not sure what your problem is (because you have not told us) , But I'm guessing

  a = console Read ();   

It reads only one letter from your console.

You can change your program on this. To make it even more strong, accept more than 1 letter input and validate that the input is actually a number:

  Double A, B; Console Farewell line ("Itenton says A. ± yÄ ± Sonna .00 Coarac Yaz"); If (double. Terry purse (console. Readline (), outside one)) {b = a * math. PI; Console.lightline ("sonu" "b"); } Else {// the user gave an invalid input to handle it here}    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -