Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a program to search a number in the given list of numbers.



Write a program to search a number in the given list of numbers...

Answer / Raghaw Kumar Jha

Here's an example of a simple Java program that searches for a number in an array:

```java
public class SearchNumber {
public static void main(String[] args) {
int numbers[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
int target = 5;

for (int i = 0; i < numbers.length; i++) {
if (numbers[i] == target) {
System.out.println(target + " found at position: " + (i+1));
break;
}
}
}
}
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What programs use java?

1 Answers  


What is constructor and virtual function?

5 Answers  


What makes a function well defined?

1 Answers  


what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0

4 Answers   Accenture,


Can we sort hashset in java?

1 Answers  


Define packages in java?

1 Answers  


What is a loop java?

1 Answers  


Can we call thread start () twice?

1 Answers  


What is garbage collection in Java, and how can it be used ?

32 Answers   Accenture, HCL, Infosys, Sara, SITS, TCS, Wipro,


What is class variable java?

1 Answers  


What is the use of collections in java? How it is implemented in real time applications?

2 Answers  


I/O blocking means?

1 Answers  


Categories