// 11/18/2019
// Searching an array

import java.util.Scanner;

public class SearchingV1 {
  public static void main(String[] args) {
   
    int[] numbers = {4, 6, 8, 10, 12};
    int val;
    Scanner sc = new Scanner(System.in);
    System.out.println("What value do you want to search for?");
    val = sc.nextInt();
    boolean found = false;
    for (int i=0; i<numbers.length; i++) {
      if (val == numbers[i]){
        System.out.println(val + " is found at loc " + i);
        found = true;
      }
      /* DO NOT PUT THIS ELSE WHICH PRINTS FOR EVERY LOC 
      else 
        System.out.println("val is not found.");
        */
    }
    if (!found) {
      System.out.println(val + " is not found in the array.");
    }
  }
}