1public class Contains {
2
3 public static void main(String[] args) {
4 int[] num = {1, 2, 3, 4, 5};
5 int toFind = 3;
6 boolean found = false;
7
8 for (int n : num) {
9 if (n == toFind) {
10 found = true;
11 break;
12 }
13 }
14
15 if(found)
16 System.out.println(toFind + " is found.");
17 else
18 System.out.println(toFind + " is not found.");
19 }
20}