grittinjames
Advanced Member level 1
- Joined
- Jun 1, 2006
- Messages
- 479
- Helped
- 44
- Reputation
- 90
- Reaction score
- 32
- Trophy points
- 1,308
- Location
- bangalore india
- Activity points
- 3,985
hai friends
int i=0;
do{
scanf("%d",&i);
printf("%d",i);
while(i>100||i<1);
in this loop if im enternimg a charecter when scanf waiting i will not change it will be 0,
while gety satsfied and again it will move to do ,
but this time scanf is not waiting for entering data ,it becoming an infinite loop
what is the problem
how i can solve it
plz help me
int i=0;
do{
scanf("%d",&i);
printf("%d",i);
while(i>100||i<1);
in this loop if im enternimg a charecter when scanf waiting i will not change it will be 0,
while gety satsfied and again it will move to do ,
but this time scanf is not waiting for entering data ,it becoming an infinite loop
what is the problem
how i can solve it
plz help me