int primes={2,3,5,7,11,13,17.19,23,29,31,37,41,43,47,53,59,61,67,73,79,83,89,97}
consider the above array of primes you have to search 67 n the array, also you have to check whether 67 is prime or not, also keep count of how many primes comes before 67.
Answers
Answered by
1
Answer:
hcfzvkghgzghckrajdosjrk
Answered by
1
Answer:
Element is present at index 17
Explanation:
int arr[] = { 2,3,5,7,11,13,17.19,23,29,31,37,41,43,47,53,59,61,67,73,79,83,89,97};
int x = 67;
int n = sizeof(arr) / sizeof(arr[0]);
// Function call
int result = search(arr, n, x);
(result == -1)
? cout << "Element is not present in array"
: cout << "Element is present at index " << result;
return 0;
Similar questions