Welcome to CodeRanch!
Ian Bray wrote:Hi I'm having a problem with doing revers for loops could someone help me and and explain to me why my code is not working it's still incomplete but I need the 2nd "B" at the end to count from let say 10-2 using only odd numbers it counts 10-2 but doesn't do the odd numbers only
I would highly recommend to use proper punctuation, so that it would be easier to understand what you are asking. Especially this part :
I need the 2nd "B" at the end to count from let say 10-2 using only odd numbers it counts 10-2 but doesn't do the odd numbers only
Ian Bray wrote:Hi I'm having a problem with doing revers for loops
First of all, why are you reversing the loops? Is it kind of an assignment? Was there any problem while using 'normal' for loops? What was the problem? Please, TellTheDetails.
Ian Bray wrote:help me and and explain to me why my code is not working
Well, unless we know what you are trying to do, and what should be the expected output, its really difficult to assist you (even if we want to).
Also, please QuoteYourSources, UseCodeTags and note that this is NotACodeMill.
Since you are new, I have added the code tags for you and you can see how much better the post looks. Unfortunately, it highlights incorrect indentation, so you can’t tell just by looking which else corresponds to which if (...). Also, you should use spaces for indenting, not tabs. You also have a design problem; the main method is not intended to hold lots of code like that. I know some books show code like that, but it doesn’t teach you object‑oriented design.
Anayonkar Shivalkar wrote: . . . UseCodeTags . . . .
If you are using Java7, you can use a switch-case with "a" "A" "b" "B" etc. as its cases.
Why are you using capital letters to start local variable names?
Why have you got Start++ as the initialisation of a for statement? That looks like very peculiar design. You should code for loops to match this example whenever possible.
Also, provided the variables stay in scope, it is probably better style to declare them as late as possible, which would be where they are initialised from the Scanner.
It is completely unnecessary to enclose your loops in those if(...) statements.
You can use this sort of loop to iterate an array backwards