Why is this happening?
Im creating a program that given the amount of rows and columns, it a grid that size displaying 0's.
Lets say Row = 2, column = 3 would look like this
000
000
But for some reason It infinatly loops, just keeps on writing 0's to the console. I tried break but it didnt work either.
EDIT : NVM I realized that I messed up the 2nd for.
Close plz
[php]#include <iostream>
int main()
{
int row, column;
std::cout << "Enter amount of rows and columns\n";
std::cin >> row >> column;
for (int i=0; i<row; i++)
{
for (int j=0; i<column; j++)
std::cout << "0";
std::cout << '\n';
}
return 0;
}[/php]
It needs to be a nested For statement also.
EDIT : NVM I realized that I messed up the 2nd for.
Close plz
Lets say Row = 2, column = 3 would look like this
000
000
But for some reason It infinatly loops, just keeps on writing 0's to the console. I tried break but it didnt work either.
EDIT : NVM I realized that I messed up the 2nd for.
Close plz
[php]#include <iostream>
int main()
{
int row, column;
std::cout << "Enter amount of rows and columns\n";
std::cin >> row >> column;
for (int i=0; i<row; i++)
{
for (int j=0; i<column; j++)
std::cout << "0";
std::cout << '\n';
}
return 0;
}[/php]
It needs to be a nested For statement also.
EDIT : NVM I realized that I messed up the 2nd for.
Close plz