int i=scanf("%d",&number); while(i!=1) { fflush(stdin); printf("Error!Enter the number again.\n"); i=scanf("%d",&number); }