Computer Science, asked by ranipooja20, 11 months ago

Program 1:Java programming
Search for Nth Occurrence
Given an array, number to search (say e1), and occurrence (say n), print the index of the nth occurrence of et in the array. If ei does not occur n times, then print the index as -1.
Input and Output:
Get the size of an array and get elements one by one. Input the number to be searched and occurrence. For example, 7 => Size of an array 1 46 7 6 3 6 => array elements 6 =>
number to be searched 3 => 3rd occurrence of number 6 Output: 6 Explanation: Number 6, 3rd occurrence position is 6
Sample Input and Output:
Input
146 7 6 36
Output:6
no use scanner

Answers

Answered by Omsiddh
1

Answer:I have uploaded a photo of program but it is of scanner. Sorry I saw the recommendation after writing the program . And I did not wanted my efforts to be wasted so I uploaded it.

Explanation:

Attachments:
Similar questions