File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes C / C++ and the fly likes generate a table for a given number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "generate a table for a given number" Watch "generate a table for a given number" New topic
Author

generate a table for a given number

nishi kishore
Greenhorn

Joined: Jun 21, 2012
Posts: 28

hello,
i want to generate a table for an integer number.
although it is a very simple program but i have to use pointer for this program.

please help me to sort out this problem
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11168
    
  16

Can you elaborate? I'm not sure what you mean by 'generate a table for a given number' - and I doubt anybody else knows either.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
nishi kishore
Greenhorn

Joined: Jun 21, 2012
Posts: 28

suppose i entered a number 2 then the output must be as follows :
2
4
6
8
10
12
14
16
18
20

but i want to generate the table using pointer for a given number.
Palak Mathur
Ranch Hand

Joined: Jan 29, 2007
Posts: 313

It means Multiplication tables. Ok.


Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11168
    
  16

nishi kishore wrote:suppose i entered a number 2 then the output must be as follows :
2
4
6
8
10
12
14
16
18
20

but i want to generate the table using pointer for a given number.


One of the toughest things to learn is that an example is not a definition of what you want to do. Yes, it can help illustrate, but you need to think about what REALLY needs to be done.

The first step is always to forget about C, Java, Perl, assembly or any other computer programming language. The first step is to LITERALLY write down the steps involved. You can write by hand, type it into notepad, or have your secretary type it in triplicate using carbon paper...but you must somehow get them written down. This step is critical in getting your brain to really think about the problem. So, for this, I would start with something like

1) get the number
2) print the table based on a number

Now, I break each of these down further. Also, note that these steps are COMPLETELY independent of each other. I can get the number by prompting the user, by passing it in from the command line, by reading it from a file, or a million other ways. What matters is that I get it somehow. Further, assuming I have a number, I need to print a table. No matter where the number came from, once I have it, printing the table is always going to be handled the same way.

So, the next step would be to pick one of the two items above, and break it down further. Give that a try, and post what you get here.
azim sain
Greenhorn

Joined: Jul 20, 2012
Posts: 14
To generate a table do

removed
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3602
    
  14

Azim, please DontBeACodeMill. You're robbing Nishi of a learning experience.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: generate a table for a given number
 
Similar Threads
Generate unique numbers from a table's primary key, to be used as an external reference.
checking wether fibanocci or not
how to generate random numbers ? Random class always generate same number....
problem with ....while(rs.next())
Question about the type of JoinColumn.