### Display a table of numbers from 50 to 150

using for loop
Please show us your code, and explain more specifically what problem you're having with it.
i cannot understand what to do in this i mean do i have to show the table of any no. lets say 2 and show its table from 50 to 150 or

i need to show table of every number from 50 to 150
i cant understand this question just explain it to me please.
Perhaps you should seek clarification from the person who assigned the question to you.
Only the person who set the question knows what they really mean.

It sounds like they just want a list of numbers from 50 to 150, but I wouldn't use the word "table" to describe that.
This is how you'd do it for a table of numbers from 0 to 9. I'll leave it to you to figure out how 50 to 150 would work.

 ``12345678910111213141516171819202122232425`` ``````#include char table[] = " ######################################\n ####" "###################################\n ############" "########################## #\n ####################" "################## #\n############################" "########## #\n# # " " # #\n# # # #" "\n# #\n# " " #\n# " " #\n# " " #\n" ; int main() { unsigned num = 0 ; for ( unsigned i=0; i
That is quite creative cire, it is definitely a very realistic looking table.
http://ideone.com/CSDk9N
using nested loop i made this
 ``123456789101112131415161718192021`` ``````#include #include void main() { int num; cout<

but i want to know that can i do this using loop only not nested loop.
Last edited on
So, basically, for each number from 50 to 150, you're printing out that number's multiplication table? I don't see that implied by the question you've posted, but it's not a bad thing to do.

A nested loop is by far the most sensible way to do it.
For one thing, he's using <iostream.h> and <conio.h> which are both nonstandard.
I am using iostream.h and conio.h its because we are using Borland turbo 3.0 I know the new compiler syntax but I am studying now that's why I am using old compiler but I am asking that It could be possible to get this output without nested loop just answer this question and you guys think it could be possible to get output without using nested loop then explain it to me

 ``` 50 * 1 =50 50 * 2 =100 50 * 3 =150 50 * 4 =200 50 * 5 =250 50 * 6 =300 50 * 7 =350 50 * 8 =350 50 * 9 =450 50 * 10 =500 51 * 1 =51 51 * 2 =102 51 * 3 =153 51 * 4 =204 51 * 5 =255 51 * 6 =306 51 * 7 =357 51 * 8 =408 51 * 9 =459 51 * 10 =510 ```

it will continue to 150 table

Last edited on
closed account (D80DSL3A)
I'm not sure which is the "more active" thread on this problem currently, whether this one (here) or this one
http://www.cplusplus.com/forum/general/97824/#msg526009

Guess I'll post here.
If I had to do it in one loop only I would let i go from 501 to 1510 then find the product of i/10 with i%10.
Watch out for cases like this one though: `50 * 10 =500`, which would turn out as 51*0. A test for this case (i%10==0) and corrective code would be needed.
Last edited on
I get it and the last guy fun2code don't no what he saying if you explaint it to me a little bit more
 ``123456789101112131415161718192021`` ``````#include #include void main() { for(int i=50;i<=150;i++) { cout<<"Table of "<
But I'm forced to ask the same question as I asked in the other thread: why? Using the nested loop is much better.
closed account (D80DSL3A)
I was thinking of something like this:
 ``1234567`` ``````for(int i=501; i <= 1510; ++i) { if( i%10 == 0 ) cout << i/10 - 1 << " * 10 = " << (i/10 - 1)*10 << endl; else cout << i/10 << " * " << i%10 << " = " << (i/10)*(i%10) << endl; }``````

 ``12`` ``````for(int i=500; i <= 1509; ++i) cout << i/10 << " * " << (i%10 + 1) << " = " << (i/10)*(i%10 + 1) << endl;``````