write a java program to check if any index in array is null or not
Answers
Answered by
0
Explanation:
public class Contains {
public static void main(String[] args) {
int[] num = {1, 2, 3, 4, 5};
int toFind = 3;
boolean found = false;
for (int n : num) {
if (n == toFind) {
found = true;
break;
}
}
if(found)
System.out.println(toFind + " is found.");
else
System.out.println(toFind + " is not found.");
}
}
Thank you❤!
Please mark me as brainliest if you liked my solution.
Also, follow me.
Answered by
0
Answer:
sorry friend I am not understanding
Similar questions