Hi I have only recently started using c# in my first year of university. I have done a little vb before but pretty much a noob.
I have to write a simple console application that counts how many coins are required to make up a particular number given by the user.
My question is how do I check that the input giving by the user is a valid integer before I convert the string (Num) to an Integer (i).
This is what I have:
while (Num = "")
{
Console.WriteLine("Please enter a value");
Num = Console.ReadLine();
}
If (Num !="")
i = Convert.ToInt32(Num);
Any help would be greatly appreciated also any constructive criticism is welcome.