can any one help me in solving a question posted by friend.....
i tried to google but i didnt find the accurate answer for my question..
i wish to 'print 1 to n' without using loops and recursion
help me please..
thanks in advance
sharathg.satya -10 Posting Whiz in Training
Recommended Answers
Jump to PostSo you want to print an unknown, variable range of numbers, without using any form of loop or recursion. Pretty much any solution with those restrictions will rely on a hidden loop or recursion at a deeper level. It becomes a question of semantics: "Is this enough of a loop …
Jump to Posti want the question to be solved without any recursion or looping concept for unknown variable range of numbers..
You don't need to repeat the requirements, you need to clarify them. For example, if I write a program that calls another pre-existing program to do the looping, does that still …
Jump to PostThere has to be a loop or recursion in some form somewhere. Since you clearly aren't able to refine your description of the problem to allow for semantic loopholes, the problem is impossible. It cannot be solved on a conventional computer.
Jump to Postso can we conclude that there is no chance to do this task without a loop or a recursion?
We can conclude that only because you've completely failed to be clear about what constitutes a loop or recursion. The usual solution is to simulate a loop with goto:
Jump to Postand if i should not even use a goto statement..
what might be the alternative..??Are you reading impaired? I've listed several alternatives, and they STILL depend on how strict your definition of iteration and recursion are. Stop asking the same damn question when you need to be more specific. …
All 31 Replies
L7Sqr 227 Practically a Master Poster
sharathg.satya -10 Posting Whiz in Training
L7Sqr 227 Practically a Master Poster
sharathg.satya -10 Posting Whiz in Training
Narue 5,707 Bad Cop Team Colleague
sharathg.satya -10 Posting Whiz in Training
Narue 5,707 Bad Cop Team Colleague
sharathg.satya -10 Posting Whiz in Training
Narue 5,707 Bad Cop Team Colleague
sharathg.satya -10 Posting Whiz in Training
charlybones 14 Junior Poster in Training
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
sharathg.satya -10 Posting Whiz in Training
sharathg.satya -10 Posting Whiz in Training
sharathg.satya -10 Posting Whiz in Training
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
sharathg.satya -10 Posting Whiz in Training
sharathg.satya -10 Posting Whiz in Training
Narue 5,707 Bad Cop Team Colleague
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
sharathg.satya -10 Posting Whiz in Training
Narue 5,707 Bad Cop Team Colleague
Salem commented: Give it up, they ain't worth the effort +17
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
sharathg.satya -10 Posting Whiz in Training
muthmuth -8 Newbie Poster
Salem commented: rubbish - won't even compile -4
bajishareef -7 Newbie Poster
sharathg.satya -10 Posting Whiz in Training
sharathg.satya -10 Posting Whiz in Training
L7Sqr 227 Practically a Master Poster
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.