Does an array contain N?

Report a typo

Write a program that reads an array of integers and an integer. The program must check if the array contains that number.

Input data format

The first line: the size of an array.

The second line: all the elements of the array separated by the space.

The third line: one integer.

Output data format

Only a single value: true or false.

Sample Input 1:

3
1 3 2
3

Sample Output 1:

true

Sample Input 2:

5
1 3 2 5 4
7

Sample Output 2:

false
Write a program in Java 17
class Main {
public static void main(String[] args) {
// put your code here
}
}
___

Create a free account to access the full topic