Z
Zivanovic
Guest
Hello,
I have a quite simple question(new to all of this).
I've made a console program that multiplies two user input numbers, here's the code :
Console.WriteLine("Enter the first number");
var first_number = decimal.Parse(Console.ReadLine());
Console.WriteLine("Enter the second number");
var second_number = decimal.Parse(Console.ReadLine());
Console.WriteLine("Answer:\n");
Console.WriteLine(first_number * second_number);
My question is, how can I make a condition that the user can't use anything else than numbers?
Thanks.
Continue reading...
I have a quite simple question(new to all of this).
I've made a console program that multiplies two user input numbers, here's the code :
Console.WriteLine("Enter the first number");
var first_number = decimal.Parse(Console.ReadLine());
Console.WriteLine("Enter the second number");
var second_number = decimal.Parse(Console.ReadLine());
Console.WriteLine("Answer:\n");
Console.WriteLine(first_number * second_number);
My question is, how can I make a condition that the user can't use anything else than numbers?
Thanks.
Continue reading...