Write a Java program to accept a number from command prompt and generate multiplication table of a number.
3. Write a Java program to accept a number from command prompt and generate multiplication table of a number.
import java.util.*;
class multiplication{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter value");
int temp = 1;
int i,a = sc.nextInt();
for(i=1; i<=10; i++){
temp = i * a;
System.out.println(temp);
}
}
}
Enter value : 5 5 10 15 20 25 30 35 40 45 50
Post a Comment