We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaeba97 commit c2f9b01Copy full SHA for c2f9b01
Searching.java
@@ -0,0 +1,26 @@
1
+import java.util.*;
2
+public class Searching {
3
+ public static void main(String[]args){
4
+ Scanner sc=new Scanner(System.in);
5
+ System.out.println("enter the number of the array :");
6
+ int num=sc.nextInt();
7
+ System.out.println("enter the numbers in the array :");
8
+ int a[]=new int[num];
9
+ for(int i=0;i<a.length;i++){
10
+ a[i]=sc.nextInt();
11
+ }
12
+ System.out.println("enter the desired number u want to find.");
13
+ int t=sc.nextInt();
14
+ for(int l=0;l<a.length;l++){
15
+ if(a[l]==t){
16
+ System.out.println("desired number is found.");
17
+ return;
18
19
20
+
21
+ System.out.println("desired number is not found.");
22
23
24
25
+}
26
0 commit comments