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: Your task is to ask the user for the number of rows and columns of a 2D array. Then, print the row number of the row where the sum of all of its elements is even. 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

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 3.10CP
icon
Related questions
Question

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
< > + 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
Transcribed Image 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning