Binary search in C++
#include<iostream> using namespace std ; int main () { int i , found = 0 , num , n , arr [ 100 ], mid , low , high ; // declaration and initialization of variables cout << "enter the size of array\n" ; //prints the msg in double colon cin >> n ; //stores the value in n for ( i = 0 ; i < n ; i ++) //for loop { cout << "\n arr[" <<i<< "] = " ; //for block cin >> arr [ i ]; //for block } cout << "Enter number to be search\n" ; //prints the msg in double colon cin >> num ; //stores the value in n low = 0 ; //initialization of low to 0 high = n - 1 ; //initialization of high to n-1 while ( low <= high ) //while loop { mid =(l ow + high )/ 2 ; if ( arr [ mid ]== num ) { cout << "Enter element is found" ; break ...