answersLogoWhite

0


Best Answer

class Table

{

int n;

void func(int n)

{

int k=2;

for(int i=1;i<n;i++)

{

System.out.println("table of "+k);

for(int j=1;j<=10;j++)

{

int a=j*k;

System.out.print(" "+a);

System.out.print(" ");

}

k=k+1;

System.out.print("\n");

}

}

public static void main(String k[])

{

Table t =new Table();

int num=Integer.parseInt(k[0]);//pass the number upto you want the tables eg:4

t.func(num);

}

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

1

12

123

1234

12345

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Using for loop write a java program to print the table of a given number on the screen?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Program for finding the factorial of the two given number using constructor?

kjhk


How do you calculate the number of pixels in an inch?

The number of pixels in an inch of a photo or a screen or a camera is given by the software. You can change it if the program alow you to do so. Thanks rylwy


Do an 8086 assembler program to find parity of a given number?

sdfsdfsfsggbcvbg


Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


Shell program to find the smallest digit of a given number?

syntax error


Need a'c' program to find given number is even or odd?

No, thanks.


Fox pro program to reverse the given number?

reverse programe in fox pro


What was the name given to the space program using three astronauts on each flight?

It was called the Apollo mission.


Is it possible to write a program using a micro-controller such that it can read the time and operate at a given time?

Yes.


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Using for loop write a progrma to print the table of a given number on the screen?

public class Table { public static void main(String[] args) { int num=Integer.parseInt(args[0]); System.out.println("Table"); for(int i=1;i&lt;=10;i++) { System.out.println(i+"*"+num+"="+i*num); } } } its the program using command line arrgument...but you have to write it in notepad and then save is into bin folder..then go through your Dos promt and then complie it by javac and then run it by java comment.in run time you should pass the value as a command line then execute...but if you want to excute this program into netbins its not allowed..then you have to take the number as a static way...


How do you calculate sum of digit of a given three digit number in visual basic?

simple program