diff --git a/binary search.c b/binary search.c new file mode 100644 index 0000000..cebfad6 --- /dev/null +++ b/binary search.c @@ -0,0 +1,20 @@ +#include +int main() +{ +int arr[]={2,4,6,7,8,9},item; +int beg=0,end=5; +int mid=(beg+end)/2; +printf("Enter the item to search\n"); +scanf("%d",&item); +while(beg<=end&&arr[mid]!=item) +{ +if(item