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?
MRehanQadri 0 Junior Poster in Training
Recommended Answers
Jump to PostHow do you know if a value is a "garbage" value?
Jump to PostThen you need to figure out what the heck a "garbage" value is before you can tell the computer how to recognize one. You can't write code to do something you yourself are unable to do manually.
Jump to PostYou 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 …
All 10 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
MRehanQadri 0 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
MRehanQadri 0 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
MRehanQadri 0 Junior Poster in Training
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Cha_1 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Reverend Jim 5,259 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
rproffitt commented: I get it. Only right answers, everything else is garbage (except in politics where all is garbage.) +12
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.