How can I check if a number exists in an array using if statement? I'm trying to print "found" if it exists and "not found" otherwise. Here is my code:
for(int i = 0; i < arr5.length; i++)
arr5[i] = (int)(Math.random()*100000 + 0);
Scanner input = new Scanner(System.in);
// here i will input my search random number
System.out.print("Input search key: ");
int searchKey = input.nextInt();