aspose 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
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
Ranch Hand

Joined: Jun 21, 2012
Posts: 30

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: 11308
    
  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
Ranch Hand

Joined: Jun 21, 2012
Posts: 30

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: 11308
    
  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: 3646
    
  16

Azim, please DontBeACodeMill. You're robbing Nishi of a learning experience.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: generate a table for a given number