#Hi, how do i fix this?

13 messages · Page 1 of 1 (latest)

languid berry
#
public class MyProgram
{
    public static void main(String[] args)
    {
    
        
    }
    
    public static void function()
    {
        int lc = 1;
        int mult = 1;
        for (int i = 1; i <= 12; i++)
        {
            System.out.println("Chart of "+i);
            lc += 1;
            for (int j = 1; j <= 12; j++)
            {
                System.out.println(lc * mult);
                mult += 1;
            }
        }
                
        
    }
}
mossy ivyBOT
#

This post has been reserved for your question.

Hey @languid berry! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

languid berry
#

I am trying to make a nested for loop to print the mutliplication tables through 1-12

#

Hi, how do i fix this?

#

okay, i found 1 problem: I forgot to put int j = 1;

#

oh and same for int i = 1; lol

#

but now my output is a bit weird...

vapid fern
#

Can't you just multiply i and j?

languid berry
#

oh yea

#

yes that works!

#

thanks man

mossy ivyBOT
# languid berry thanks man

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.