programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering OS Languages Paradigms IDEs Build Tools Frameworks Products This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# Nested loop

Krunk Junk
Greenhorn
Posts: 2
Ok, so here is what I have so far.. I'm trying to get the multiples of user input all the way up to 10. So it will be
1X1=1 1X2=2 1X5=5
2X1=1 2X2=4
and so on.

I have it going horizontally and with some multiples, but I don't know what else to do and need someone's help. I just started java programming so your help is appreciated.

Greenhorn
Posts: 22
Krunk Junk wrote:Ok, so here is what I have so far.. I'm trying to get the multiples of user input all the way up to 10. So it will be
1X1=1 1X2=2 1X5=5
2X1=1 2X2=4
and so on.

I have it going horizontally and with some multiples, but I don't know what else to do and need someone's help. I just started java programming so your help is appreciated.

Specify your requirement clearly. Do you want the multiples of an entered number?
If I understand correctly, is it like

2X1 = 2
2X1 = 4
2X1 = 6
2X1 = 8
2X1 = 10
2X1 = 12
2X1 = 14
2X1 = 16
2X1 = 18
2X1 = 20

If so, then I do not understand the need of looping twice. A single loop should do the job,

And well, if you need something like this,
entered number is 3 and you want the 10 multiples each from number 1 to 3, still your loops are not right.

Work out something on these lines