Fine... here's the same thing in C:
int number = 32;
int n1, n2;
int count = 1;
printf("*** Try %i ***\n", count);
printf("Enter two numbers, separated by a space, that multiply to give %i:\n", number);
scanf("%i %i", n1, n2);
while ((n1 * n2) != number) {
printf("Wrong answer!\n\n")
count++;
printf("*** Try %i ***\n", count);
printf("Enter two numbers, separated by a space, that multiply to give %i:\n", number);
scanf("%i %i", n1, n2);
}
printf("Right answer! You got it!\n");
Granted, it's nowhere near perfect, but it's a start. As you might have noticed, I'm not exactly a pro. Of course, your solution minus the error checking wins. And about the redundant code: it's either that or use flags, if you want to signal a wrong answer. And I don't like flags
