without nested loops i need a program that prints the set of numbers between any two numbers ???
help me plz

Recommended Answers

All 3 Replies

Have you tried writing this yourself yet? Show us some work, and we'll help you get moving in the right direction.

This is sudo code but you shoud be able to get it to work

for index = startIndex to index = endIndex
    print array[index]

By "nested loops", do you mean a loop within a loop? In this case, you don't need a nested loop anyhow.

But you will probably need one non-nested loop. "NathanOliver" gave an example of pseudo-code.
Not sure how else you could do it. Recursively?!

I suppose it depends on the format in which the data comes: in an array, ordered, spacing, in a string, etc.

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.