Java Program to Print Multiplication Table of any Number Using While Loop Full Project For Beginners

 

 

main.java

 

 

// Java Program to print the multiplication table of
// number N using while loop

class GFG {
	public static void main(String[] args)
	{
		// number n for which we have to print the
		// multiplication table.
		int N = 7;

		int range = 18;

		// looping from 1 to range to print the
		// multiplication table of the number.
		int i = 1;

		// using while loop
		while (i <= range) {

			// printing the N*i,ie ith multiple of N.
			System.out.println(N + " * " + i + " = "
							+ N * i);
			i++;
		}
	}
}

Leave a Reply