Personally, I kind of like this style, but it is inefficient (and can potentially lead to a stack overflow if the user has entered invalid input a huge number of times). Your teacher probably wanted you to use the while :
Console.Write("Please give the value no "+ index + " :"); while (false == int.TryParse(Console.ReadLine(), out num)) {
By the way, this false == bit is very non-idiomatic and will raise eyebrows on most commands (as a note: if your instructor advised you to write this, it probably comes from a different language background where this is a guarantee against accidental assignment, believe me, this is not necessary or normal on land C #). This looks a lot more typical:
while (!int.TryParse(Console.ReadLine(), out num)) {
source share