Movie tickets C++ exerise | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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; }

18th Jun 2021, 7:22 PM
Ryan Dahlman
Ryan Dahlman - avatar
3 Answers
+ 2
can you share problem statement because we non pro members cant see those questions
18th Jun 2021, 7:31 PM
Prashanth Kumar
Prashanth Kumar - avatar
+ 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...
18th Jun 2021, 7:43 PM
Jayakrishna 🇮🇳
0
That did it! Can't believe I overlooked that. Thank you for suggestion
23rd Jun 2021, 5:53 PM
Ryan Dahlman
Ryan Dahlman - avatar