Suppose I'm running a loop and the loop should continue unless I get a garbage value.
So what will be the terminal condition. How can garbage value be checked in if condition?
You can't define what is a garbage value any more than you can write down all the wrong answers to a question. You decide what constitutes a correct value and try to define a pattern that matches all correct values. Anything else is garbage. A pattern for an integer might … Read More