This is a simple code from my assignment. I only want numbers 0 to 9. I'm not sure why, if i remove the "input1 != 0", everything's fine. But when i include it, it goes berserk.

Moreover, even if i remove "input1 != 0", if i type in any thing starting with 1, it still carries on like usual. 

How do i solve this problem? 

#include 
using namespace std;

int main(){
    
    int input1;
    
start:
    cout > input1;
    if (input1 != 9 && input1 != 8 && input1 != 7 && input1 != 6 && input1 != 5 && input1 != 4 && input1 != 3 && input1 != 2 && input1 != 1 && input1 != 0){
        cin.clear();
        cin.ignore(10000,'\n');
        cout