n=int(input ("Enter the number of elements in the array: "))
i =0
1=[]
for i in range(n):
Num=int(input())
append(num)
print("Array is: ", 1)
Val= int(input("Enter the number to be searched: "))
Beg=0
end=n-1
found =0
while(beg<-end):
mid=int[(beg+end)/2]
if(1[mid]==val):
print("Number found at position:", mid)
found =1
break
elif(1[mid] > val):
end=mid-1
elif(1[mid] < val):
beg=mid+1
if(found==0):
print("Number not found")
To embed this project on your website, copy the following code and paste it into your website's HTML: