Here is the Program of Binary Search
Searching refers to Search an element in a given Array whether elements are in Ascending Order or Descending Order, Binary Search is also a type of Searching Technique.
See below the Source Code of Binary Search
void main()
{
clrscr();
int a[10],i,n,m,l=0,h=9;
cout<<"\n\n\n\t Enter 10 Values in ascending order:\t";
for(i=0;i<=9;i++)
cin>>a[i];
cout<<"\n\n\t\t Enter a value to be searched :\t";
cin>>n;
while(l<=h)
{
m=(l+h)/2;
if(a[m]==n) ...... [ Read More ]
Direct Download [.CPP format] – Binary Search Program
[To download file, just Right Click and click Save Target As]


