0
Movie tickets C++ exerise
Test case fails stating there is no input or output but code is as shown below. Note sure what is it looking for. #include <iostream> using namespace std; int main() { int rows = 6; int cols = 6; float matrix[rows][cols] = { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, }; // your code goes here for (int r=0;r>6;r++){ for (int c=0;c>6;c++){ matrix[r][c] = 1; cout << matrix[r][c]; } cout << endl; } return 0; }
3 Respuestas
+ 2
can you share problem statement
because we non pro members cant see those questions
+ 2
Your conditions in loops both are initially false.. so you don't get output..
You are using r>6 , c>6 . You must use < instead of > .
r<6, c<6 to run the code..
edit: GreenRanger121
Am not tested logic there, hoping you can do else...
0
That did it! Can't believe I overlooked that. Thank you for suggestion