At Westonci.ca, we connect you with experts who provide detailed answers to your most pressing questions. Start exploring now! Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.
Sagot :
Answer:
Follows are the cdo0de to this question:
import java.util.*;//package
public class Table //defining class Table
{
public static void main(String[] asx)//main method
{
int x,y,i;//defining integer variables
Scanner bg=new Scanner(System.in);//creating Scanner class object
System.out.print("Enter first number: ");//print message
x=bg.nextInt();//input value
System.out.print("Enter Second number: ");//print message
y=bg.nextInt();//input value
for(i = 1; i <= y; i++)//defining for loop for print Table
{
System.out.printf("%d * %d = %d \n", x, i, x * i);//calculate and print table
}
}
}
Output:
Enter first number: 5
Enter Second number: 3
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
Explanation:
In the above code, three integer variable "x,y, and i" is declared, in which "x,y" variable is used to input value from the user end, and after input, the value the for loop is used, in which the second variable "y" count the rows, and "i, x" variable is used for calculates the multiplication of the table.
We hope this information was helpful. Feel free to return anytime for more answers to your questions and concerns. Thanks for using our platform. We aim to provide accurate and up-to-date answers to all your queries. Come back soon. Westonci.ca is here to provide the answers you seek. Return often for more expert solutions.