Given an Array of 5 element, and a number num, Find out if the number is present or not in an array.
If it is present, return the index of it.
If it is not present, return -1.
arr[]={1,2,3,4,5}
num=4
Output: 3 (since 4 is present in index 3, as index starts from 0
arr[]={1,2,3,4,5}
num=8
Output: -1 (since element is not found)
Published By : Suraj Ghimire