# Thread: Multiplication Table

1. ## Multiplication Table

So i have been gone off the forums for about 9 months or so for various reasons i rather not discuss and this is my first post back so some quick help would be fantastic

So I have this program
Java Code:
```package hello;
import java.io.*;
public class hello2 {
public static void main(String[] args)throws IOException
{
int bcnt=0;
int cnt=1;

while(bcnt<end)
{
bcnt++;
for(cnt=0; cnt<Num_Of_Multiples; cnt++);
{
System.out.print(cnt*Num_Of_Multiples+" ");
}
}
System.out.println();
System.out.println(cnt);
System.out.println(Num_Of_Multiples);
System.out.println(bcnt);
System.out.println(strt);
System.out.println(end);

}

}```
And my problem is that i need it to do something like this
Java Code:
```2 4 6 8 10
3 6 9 12 15
4 8 12 16 20 etc...Depending on what strt and end are and Num_Of_Multiples controlss how many times it multiplies before going to the next row```
And i am just getting
Java Code:
```2//strt //what i entered
4//end //what i entered
5//Num_Of_Multiples //what i entered
25 25 25 25 // output
5//cnt
5//Num_Of_Multiples
4//bcnt
2//strt
4//end```
And i have no earthly idea of what is going on can anyone help me out

All help is appreciated:)

2. For one thing, this semicolon is making your for loop useless:
Java Code:
```      for (cnt = 0; cnt < Num_Of_Multiples; cnt++); // <==== this semicolon ****
{
System.out.print(cnt * Num_Of_Multiples + " ");
}```
For another you'll need to work out the basic math involved here. Plan to use a lot of paper and a pencil and you will solve it, since I know you've got the brain power to do it.

Much luck!

3. hint: are you sure you want bcnt to start at 0?

4. ah crap the dang semicolon i havent programmed in java i a while and i forgot some syntax and i have the math now thanks for pointing out the semicolon:)

5. Originally Posted by SwEeTAcTioN
ah crap the dang semicolon i havent programmed in java i a while and i forgot some syntax and i have the math now thanks for pointing out the semicolon:)
Sometimes you need to just walk away from the code for a while to see it anew.

You're welcome and I'm sure I speak for all when I say welcome back!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•