Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an array of size given by the user. Write a function to find a number taken as input from user. Your task is to


Create an array of size given by the user. Write a function to find a number taken as input from user. Your task is to print the index of the number using pointer to travel the array.

Input Format

Firstly, take array size and elements as input. Then take a value to search in array.

Constraints

void find(int *pA, int sA, int v)

Note that if number is found at multiple position you should print all position.

Output Format

Your task is to print the index of the number using pointer to travel the array.

Sample Input 0

61 2 3 2 4 22

Sample Output 0

2 found at index 22 found at index 42 found at index 6

Create an array of size given by the user. Write a function to find a number taken as input from user. Your task is to print the index of the number using pointer to travel the array! Input Format Firstly, take array size and elements as input. Then take a value to search in array. Constraints void find (int *pA, int sA, int v) Note that if number is found at multiple position you should print all position. Output Format Your task is to print the index of the number using pointer to travel the array. Sample Input 0 6 123 24 2 2 Sample Output 0 2 found at index 2 2 found at index 4 2 found at index 6 Explanation 0 **Input* Here, Array size: 6 Array elements: 1 2 3 2 4 2 Search value: 2 **Output**: 2 found at index 2 2 found at index 4 2 found at index 6

Step by Step Solution

3.41 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

include void findint pA int sAint v i... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Structures and Algorithms in Java

Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

6th edition

1118771334, 1118771338, 978-1118771334

More Books

Students also viewed these Programming questions