Question: Write a simple and very basic C + + program ( using array ) : Exercise# 1 : Searching in arrays Declare two integer arrays

Write a simple and very basic C++ program (using array):
Exercise#1: Searching in arrays
Declare two integer arrays arr1 and arr2 of size 10. Fill both arrays with the random numbers from 5 to
Display two arrays side to side as shown in the sample output. Input an integer n. Check if n is found
in any of the arrays and print its location if it is found. That is display all locations of n in each array, if any
Please note that your output will be different because the arrays are initialized randomly.
Enter a number: 20
20 was found in both arrays
Iocation of 20 in Array #1:4
Location of 20 in Array #2:6
Enter a number: 12
12 was found in 1 array
Location of 12 in Array #1: 1
Write a simple and very basic C + + program (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!