HELP... error in my simple binary search program
Could any help me with a runtime error in my program?
In the program of binary search, I am not getting output if I choose my searching element more than the middle element.
Could anyone please help me to debug it?
using namespace std;
cout<<"\nEnter the number of elements you want to enter in an array: ";<br />
cout<<"\nEnter the array: ";<br />
cout<<"\nEnter the element you want to search: ";<br />
cout<<"\nThe element you searched is "<<a[mid]<<" and is at position "<<pos<<endl;<br />
cout<<"\nThe element you were trying to search was not found !"<<endl;<br />