You are viewing a single comment's thread. Return to all comments →
I think the comparision could be the condition of the while cycle:
public static void main(String[] args) {
Scanner scan = new Scanner(System.in); int search = scan.nextInt(); scan.nextInt(); int i = 0; while(scan.nextInt() != search){ i++; } System.out.println(i); }
Seems like cookies are disabled on this browser, please enable them to open this website
Intro to Tutorial Challenges
You are viewing a single comment's thread. Return to all comments →
I think the comparision could be the condition of the while cycle:
public static void main(String[] args) {