public class Main { public static void main(String args[]) { int x=1,n=5; while(x<=10) { System.out.println(x+"*"+n+"="+x*n); x++; } } }
1*5=5
2*5=10
3*5=15
4*5=20
5*5=25
6*5=30
7*5=35
8*5=40
9*5=45
10*5=50
public class Main { public static void main(String args[]) { int x=1,n; n=Integer.parseInt(args[0]); while(x<=10) { System.out.println(x+"*"+n+"="+x*n); x++; } } }
1*5=5
2*5=10
3*5=15
4*5=20
5*5=25
6*5=30
7*5=35
8*5=40
9*5=45
10*5=50
import java.util.*; public class Main { public static void main(String args[]) { int x=1,n; Scanner s=new Scanner(System.in); System.out.println("Enter n value : "); n=s.nextInt(); while(x<=10) { System.out.println(x+"*"+n+"="+x*n); x++; } } }
Enter n value : 5
1*5=5
2*5=10
3*5=15
4*5=20
5*5=25
6*5=30
7*5=35
8*5=40
9*5=45
10*5=50