diff --git a/binary_search.c b/binary_search.c new file mode 100644 index 00000000..4f6773ea --- /dev/null +++ b/binary_search.c @@ -0,0 +1,36 @@ +#include +#define MAX 100 +void main() +{ +int array[MAX],l,r,mid,n,x,flag=0,i; +printf("enter the no of elements\n"); +scanf("%d", &n); +printf("enter the elements of the sorted array\n"); +for(i=0;iarray[mid]) + {l=mid+1; + mid=(l+r)/2; + } + +} +if(flag==0) + printf("The element is not found\n"); + +}