HELP!!!!!!!!!!!!

Create a program in C++ that will enter a limit of the loop using for loop statement.

FOR LOOP -->> 3 limit

for ( )
for ( )
for ( )
cout

SAMPLE OUTPUT

Enter a limit of loop : 3 [enter]

1 2 3 the output is in 3 by 3 , 3 row and 3 col
4 5 6
7 8 9

2 3 4
5 6 7
8 9 10

3 4 5
6 7 8
9 10 11
Last edited on
Open any book in c++ 2D arrays. You will find your question as a sample to how to create, store, and retrieve your 2D array. Don't get me wrong, if you don't show some effort for your self, you gonna struggle .
The only required is for loop statement . :/
Ok, the loop should look likes

for (int rows = 0; i < Number_Rows; i++)
{
for (int cols = 0; cols < Number_Columns; cols++)
cout << array[rows][cols] << endl;
}
Last edited on
i need is using 3 for loops :(
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int count = 0;
for(int i =1; i < limit_of_loop + 1; i++)
{
    int count = i;
    for(int j =0; j < 3; j++)
   {
            for(int k =0; k < 3; k++)
           {
              cout<<count<<"  ";
              count++;
           }  
           cout<<"\n"
   }  
  cout<<"\n\n\n"
}
Last edited on
thank you .:)) but i have a problem .. although limit_of_loop + 1 is valid but it's not recommeded :! how can i solve that ?
Yikes, please read>>> http://linuxsilo.net/docs/smart-questions_en.html

although limit_of_loop + 1 is valid but it's not recommeded :! how can i solve that ?

Not recommended by who? Solve what? How does the code you've already been given not do what you asked? Are you making any attempt of you own on this??? If so, let's see some code so we can get an idea what you're actually asking...
sorry . .misunderstanding:)
Than make it less than or equal to (<=)...
Topic archived. No new replies allowed.