pretty simple here.. here's a little example I whipped up in C#
while (true)
{
Random rand = new Random();
int x = rand.Next(0, 11);
int y = rand.Next(0, 11);
Console.WriteLine("How much is " + x + " times " + y + "?");
int response = int.Parse(Console.ReadLine());
while (response != (x * y))
{
Console.WriteLine("Sorry, that is incorrect, please try again");
response = int.Parse(Console.ReadLine());
}
Console.WriteLine("Correct!");
}