r/C_Programming • • May 29 '26

Question HELP!!!!

   while(1){
        if(scanf(" %d",&input_choice)==1){
            break;
        };
        
        while(1){
            if(getchar()=='\n'){
                break;
            }
        }
    };
Guys what am i doing wrong can you please tell me .
 i am sorry if i am asking very basic thing . i read some documentation online but couldn't figure out what is going wrong 
0 Upvotes

19 comments sorted by

View all comments

Show parent comment

1

u/UsualLonely4585 May 29 '26

You didn't change anything and this still works ?