
-----------------------------------
slider203
Thu Mar 11, 2010 8:46 pm

Loops program error no output
-----------------------------------
Hello I cant seem to find the error in my program I have tried everything I can think of I guess im just no good with loops...I would appreciate it if someone could take a look


class Hello
{
public static void main (String args 

When I compile it outputs LoopProgram but nothing else..
Any help is appreciated.

-----------------------------------
chrisbrown
Thu Mar 11, 2010 8:55 pm

RE:Loops program error no output
-----------------------------------
for (int counter = beta; counter >= alpha; counter -= 1) 

This for loop will loop until (counter >= alpha) is false; in other words, until counter is less than alpha.
If counter starts with value 2 and alpha is 10, is counter greater or less than alpha?

-----------------------------------
slider203
Thu Mar 11, 2010 9:15 pm

Re: RE:Loops program error no output
-----------------------------------
for (int counter = beta; counter >= alpha; counter -= 1) 

This for loop will loop until (counter >= alpha) is false; in other words, until counter is less than alpha.
If counter starts with value 2 and alpha is 10, is counter greater or less than alpha?

The counter is less than alpha
so would the for staatment look like this:

for (int counter = beta; counter = beta; ...

-----------------------------------
slider203
Thu Mar 11, 2010 9:39 pm

RE:Loops program error no output
-----------------------------------
Ok thanks this really helped I'd give you karma but I dont have enough posts sorry :(
