Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generate a table for a given number

 
nishi kishore
Ranch Hand
Posts: 32
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 12097
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
nishi kishore
Ranch Hand
Posts: 32
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 341
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means Multiplication tables. Ok.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12097
30
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To generate a table do

removed
 
Stephan van Hulst
Bartender
Pie
Posts: 5574
53
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Azim, please DontBeACodeMill. You're robbing Nishi of a learning experience.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic