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

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter8: Working With Trendlines, Pivottables, Pivotcharts, And Slicers
Section: Chapter Questions
Problem 7EYW
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
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
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 Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage