![]() |
arrays??
can anyone try to help me getting an output like this:
ull be able to input a number for example.. 12 and its output is like this... 12 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 .................... .................. ................... 3 2 1 2 1 1 i'm a noob programmer and can't figure how to start please help me thanks in advance... |
Re: arrays??
You'll need what's called a nested loop. You have one loop that counts down from 12 to 1, and inside that loop have another loop that counts down from the value of the iteration you're in to 1. The logic goes something like this:
:
loop from i = 12 to 1 |
Re: arrays??
ouch still can't follow... Ooble can u do the whole loop?
|
Re: arrays??
You'll need to show some effort FengLing. What Ooble told you should be enough to get you started on some code. Where is your code?
|
Re: arrays??
pls. help jst limit the number to 3
3 2 1 2 1 1 so that i can get a little idea... |
Re: arrays??
OpenLoop can u translate the sample of Ooble to C...
|
Re: arrays??
Quote:
|
Re: arrays??
ok then what loop statement should i use?...
|
Re: arrays??
a For loop will do.
|
Re: arrays??
A 'for' loop is most appropriate for this situation. You will need two of them - a loop within a loop.
|
| All times are GMT -5. The time now is 4:19 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC