import java.util.Scanner;
public class Main
{
public static void Search(int[] arr, int k){
for(int i=0;i<arr.length;i++){
if(arr[i] == k){
System.out.println("The product is found.");
break;
}
}
System.out.println("The product is not found.");
}
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int[] arr= {121,122,123,124,125,126,127};
System.out.println("Enter the product code to search:");
int product_code=in.nextInt();
Search(arr,product_code);
}
}
Comments
Leave a comment