When I am running this code, it is showing expected result
#include
using namespace std;
int main()
{
int arr[5][3]={0};
//Iterate over the array
for(int rows=0;rows<=4;rows++)
{
for(int cols=0;cols<=2;cols++)
{
cout<<arr[rows][cols];
}
}
return 0;
}
However, if I run this code, the prompt returns to itself without showing any output, why? Is this related to time complexity?I am new to that.
#include
using namespace std;
int main()
{
int arr[1000][1000]={0};
//Iterate over the array
for(int rows=0;rows<=4;rows++)
{
for(int cols=0;cols<=2;cols++)
{
cout<<arr[rows][cols];
}
}
return 0;
}