Question: Correct my mistake #include using namespace std; int SearchPerfectValue ( int a [ ] , int n , int val ) { int i; for
Correct my mistake #include
using namespace std;
int SearchPerfectValueint a int n int val
int i;
for i ; i n; i
if ai val return i;
return ;
void ShowArrayint a int n
int i;
for i ; i n; i
cout ai;
cout endl;
int main
int a; reserve index position
int val, n founf;
cout "Enter Array Size between to : endl;
cin n;
srandtime;
for int i ; i n; i
ai rand; populate the array in order
cout "Elements of the array; endl;
ShowArraya n;
cout
Enter a search perfect value: endl;
cin val;
found SearchPerfectValuea n val;
if found
cout "The search value was found at index position: found endl;
else
cout "The search value was not found." endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
