0

Search for a number in an Array of integers of size ‘n’

Java

28th Nov 2021, 1:57 AM
Muntaha
4 ответов
+ 4
Java and Javascript are different languages. Use a web search for questions like this.
28th Nov 2021, 2:00 AM
Simon Sauter
Simon Sauter - avatar
+ 3
Muntaha You have completed 92% of the Java tutorial. Everything you need to know has already been presented to you. Instead of asking others to do all your work, start reviewing your tutorial. As Rishi has stated, iterate through your list and inspect each item. Review loops in your tutorial
28th Nov 2021, 2:58 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
Traverse the array. It's the simplest method. In Java, it is something like the below snippet for(int element:array) { if(element==element_to_find) { //You've found your element, you can exit the for loop here } } The variable names are intuitive and correspond to the corresponding variables
28th Nov 2021, 2:48 AM
Rishi
Rishi - avatar
+ 1
I need the steps of program
28th Nov 2021, 2:14 AM
Muntaha