+ 1
How to write a java program to print table of any number
https://www.sololearn.com/discuss/150796/?ref=app https://code.sololearn.com/cs340559e7SRy/?ref=app https://code.sololearn.com/ce8y7c4s8IH6/?ref=app https://code.sololearn.com/c340559e7SRy/?ref=app
2 Answers
0
Umang,
Its very easy. I will share the Algo with you.
1. Get table number from user example variable is n
2. Start a loop from 1 - 10 example loop variable is i
3. In each iteration you need expression like 'i * n =' i*n
That' it
Scanner sc=new Scanner(System.in);
int n,i;
System.Out.Println("Enter number");
n = sc.nextInt();
for(i=1; i<=10; i++)
{
System.Out.Println(i + " * " + n + " = " + (i*n));
}
Thanks - Salman
0
thanks