Use for loops on the above 2D array to: •Find how many ZEROsand how many negative numbersare in the matrixand display result
Use for loops on the above 2D array to: •Find how many ZEROsand how many negative numbersare in the matrixand display result
Chapter6: Using Arrays
Section: Chapter Questions
Problem 19RQ
Related questions
Question
Use for loops on the above 2D array to: •Find how many ZEROsand how many negative numbersare in the matrixand display results
*HELP: declare a variable “count_zero= 0and count_neg=0” and increment the count each time you findzero and negative
•Create an array of size 7 of integers1, -9, 10, 20, 5, 6, 7 . You can set these numbers in the code with initialization.
•Write a function that accepts anarray and returns the location/index of any value passed to the function.
Test it with value 20 and value -1 *HELP: this is linear search
•Test it with value 7and write code in your “main” to see if it is the last element in the array (10 points)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
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.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage