QUOTE(villalandron @ 1 Jul, 2009 - 07:59 PM)

QUOTE(computerfox @ 1 Jul, 2009 - 06:18 PM)

QUOTE(villalandron @ 1 Jul, 2009 - 06:12 PM)

I am having problems with this program. I need to build a program that will demonstrate a loop that will print the following output by using two loops:.
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
Here's what I have so far:
CODE
import java.util.Scanner;
public class TwoLines
{
public static void main (String[ ] args)
{
Scanner keyboard = new Scanner(System.in);
for (int number = 1; number <=10; number++)
System.out.print("\t" + number);
System.out.print("\n");
for (int num = 11; num <= 20; num+=1)
System.out.print("\t" + num);
}//end main method
}//end class
Thank you for your help!
where's your question?

but just to let you know:
CODE
for (int number = 1; number <=10; number++)
System.out.print(number+" ");
System.out.print("\n");
for (int num = 11; num <= 20; num++)
System.out.print(num+" ");
hope that helps

Honestly, I don't know why I made that question because after looking at the last post made me realize that I knew how to do that. Anyways, thank you for opening my eyes and help me realize that I need to properly check my stuff before wasting your time with something I already knew. Still, hope other viewers receive help from this post. Thank you for the reply!
Actually, this I don't know. If I wanted to make a program perform this output:
1 2
3 4
5 6
7 8
9 10
How would I do it? I've been trying but this is as close as I can get:
CODE
import java.util.Scanner;
public class TwoLines
{
public static void main (String[ ] args)
{
Scanner keyboard = new Scanner(System.in);
for (int number = 1 && int num = 1; number <=5; number++)
System.out.println("\t" + number);
}//end main method
}//end class