Let me explain you this: SIZE > 2 && SIZE > 100
is equal to SIZE > 100
because every number > 100 is > 2.
Maybe you want to do this: }while(SIZE>2 && SIZE<100)
If you want to accept 2 and 100 too, use >= and <= instead of > and <.
thanks for your replay. }while(SIZE>2 && SIZE<100) this is the opposite of what i need. I need to accept numbers that are greater then 2 and less then 100 so if the user enters 1 it should ask the user to enter a number again and if the user enter 101 then the user need to enter a number again. Finally if the user enter anything between 2 and 100 then it works.