## Practice Exercises Java

Learn to program performing exercises with Java

## 12 Lessons Java with the Solutions - 228 Exercises Java with the solutions For Beginners, Intermediates and Advanceds

The human knowledge belongs to the world
¡The infomation should be free!

# Multiplication table - Practice Exercises Java

## Source Code:

``````import java.util.*;
public class Main
{
public static void main(String[] args)
{
int x;
int result;
System.out.println("Enter a number:");
x = Integer.parseInt(new Scanner(System.in).nextLine());
result = x * 0;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 0, result);
result = x * 1;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 1, result);
result = x * 2;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 2, result);
result = x * 3;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 3, result);
result = x * 4;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 4, result);
result = x * 5;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 5, result);
result = x * 6;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 6, result);
result = x * 7;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 7, result);
result = x * 8;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 8, result);
result = x * 9;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 9, result);
result = x * 10;
System.out.printf("The result is: %1\$s x %2\$s = %3\$s" + "\r\n", x, 10, result);
}
}``````
Exercisey 1.8