PYHTON PROGRAM
n=int(input ("Enter array size:"))
arr=[]
print("Enter",n,"elements in array one by one:")
for i in range(0,n):
s=int(input())
arr.append(s)
x=int(input("Enter number you want to search:"))
for i in range(0,n):
if arr[i]==x:
print("You enterd number",x,"is found at position:",i+1)
break
else:
print("You enterd number is not found")
No comments:
Post a Comment
let me know which type examples you want to comment me.