Hi all

I'm playing with C code after coding with C# and I was trying to validate that user in putted data was an integer, some how all I've managed to do is create an infinite loop. Could someone please look over my code and let me know how to get the desired result.

Thanks
Code:
printf("Please enter the number of rectangles you wish to add: ");

isInteger =scanf("%d", &noRectangles);

while (isInteger == 0)
{

printf("Error: Sorry the data you entered was not numerical. Please enter a numerical value. \n");

printf("Please enter the number of rectangles you wish to enter: ");

isInteger =scanf("%d", &noRectangles);
continue;

}