ics noob

Greenhorn
+ Follow
since Oct 01, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ics noob

How do I repeat this until the user wants to quit?

import java.util.Scanner;
public class multi
{

public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int n;
System.out.println("Enter # here for a #*# table");
n = keyboard.nextInt();




System.out.print(" |");
for (int j = 1; j <= n; j++)
System.out.print(" " + j);
System.out.print('\n');
System.out.print(" ");
for (int i= 0; i<n; i++)
System.out.print("---");
System.out.println("");
for (int i = 1; i <= n; i++)


{
System.out.print(" " + i + "|");
for (int j = 1; j <= n; j++)
{
String display = "";

if (i * j < 10)
{
display += " " + i * j;
System.out.print(display);
}
else
{
display += " " + i * j;
System.out.print(display);
}
}
System.out.print('\n');
}
}

}
11 years ago