#include <stdio.h>
int main()
{
int num=1;
int numberRead = 0;
do{
printf("Enter a number: ");
numberRead = scanf("%d",&num);
while(numberRead != 1){
printf("That is not a number.
");
scanf("%*[^
]"); //or fflush(stdin);
printf("Enter a number: ");
numberRead = scanf("%d",&num);
}
printf("You entered %d
",num);
}while(num != 0);
return 0;
}