2. First Even Road (C PROGRAMMING) by CodeChum Admin I've been newly assigned as the city's road planner but this job seems tougher than I thought! Almost all of the roads in this city are uneven. To...





2. First Even Road   (C PROGRAMMING)


by CodeChum Admin






I've been newly assigned as the city's road planner but this job seems tougher than I thought!



Almost all of the roads in this city are uneven. To fix these, I need to find an even road as a reference. Fortunately, the mayor told me that there's 1 even road somewhere and if I persevere, I could find it.



Could you please help me with this?




Instructions:



  1. Your task is to ask the user for the number of rows and columns of a 2D array.

  2. Then, print the row number of the row where the sum of all of its elements is even.

  3. For this problem, it is guaranteed that there is one and only one such row.






Input




1. Number of rows




2. Number of columns




3. Elements of the 2D array







Output


Note that the row number starts at 0, not 1.




Enter # of rows: 3

Enter # of columns: 3

Enter elements:

2 7 4

1 1 2

0 5 0


Even row: 1



main.c<br>< > + c<br>Test Cases<br>Output<br>1<br>Note that the row number starts at 0,<br>not 1.<br>CE Run Tests<br>Enter # of rows: 3<br>Enter # of columns: 3<br>Test Case<br>Enter elements:<br>1<br>2-74<br>11 2<br>Test Case<br>2<br>Even row: 1<br>Test Case<br>3<br>

Extracted text: main.c <> + c Test Cases Output 1 Note that the row number starts at 0, not 1. CE Run Tests Enter # of rows: 3 Enter # of columns: 3 Test Case Enter elements: 1 2-74 11 2 Test Case 2 Even row: 1 Test Case 3

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here