as i understand his problem machan he wants it to be a number less than 10.. but your solution is not going to work as it is going to be a char array which will take in the question.. such as 5^5 which should return the answer 3125 (5x5x5x5x5)... but what is the user enters a two digit number for the question...such as 5^10... then there is a problem of finding the proper answer...
Machan Fazaal i think what u should do is run the loop until u find a ^...add all the characters to a char array before the ^
and then pass the char array to a function named atoi
check how to use atoi
EDIT : atoi does not seem to be working on C#... but if its C# its gonna be even more easier because there is a String Class... and Int32.Parse could do the job... but what i feel is like you are asking for C help