import java.util.*;
class table
{
public static void main (String argsp[])
{
Scanner in = new Scanner (System.in);
int a,b,c,d=0;
System.out.print ("\n\t Enter the number to print table = ");
a=in.nextInt();
System.out.print ("\n\t Enter 1 for ascending and 2 for descending order = ");
c=in.nextInt();
if (c==1)
{
System.out.println ("\n\t Table of "+a+" in ascending order ");
b=1;
while (b<=10)
{
d=b*a;
System.out.println ("\n\t "+a+" * "+b+" = "+d);
++b;
}
}
else if (c==2)
{
System.out.println ("\n\t Table of "+a+" in ascending order ");
b=10;
while (b>0)
{
d=b*a;
System.out.println ("\n\t "+a+" * "+b+" = "+d);
--b;
}
}
else
System.out.println ("\n\t Invalid number ");
}
}
class table
{
public static void main (String argsp[])
{
Scanner in = new Scanner (System.in);
int a,b,c,d=0;
System.out.print ("\n\t Enter the number to print table = ");
a=in.nextInt();
System.out.print ("\n\t Enter 1 for ascending and 2 for descending order = ");
c=in.nextInt();
if (c==1)
{
System.out.println ("\n\t Table of "+a+" in ascending order ");
b=1;
while (b<=10)
{
d=b*a;
System.out.println ("\n\t "+a+" * "+b+" = "+d);
++b;
}
}
else if (c==2)
{
System.out.println ("\n\t Table of "+a+" in ascending order ");
b=10;
while (b>0)
{
d=b*a;
System.out.println ("\n\t "+a+" * "+b+" = "+d);
--b;
}
}
else
System.out.println ("\n\t Invalid number ");
}
}