programme:- to check that the given numbers is present in the list or not.
import java.util.*;
public class array2
{
public static void main(String args[])
{
int x[]={4,3,5,6,2};
int i,z;
System.out.println("enter the value of z");
Scanner sc=new Scanner(System.in);
z=sc.nextInt();
for(i=0;i<5;i++)
if(x[i]==z)
{
System.out.println("number is present in list");
}
}
}
this programme helps you to find your numbers in large bank of numbers.
import java.util.*;
public class array2
{
public static void main(String args[])
{
int x[]={4,3,5,6,2};
int i,z;
System.out.println("enter the value of z");
Scanner sc=new Scanner(System.in);
z=sc.nextInt();
for(i=0;i<5;i++)
if(x[i]==z)
{
System.out.println("number is present in list");
}
}
}
this programme helps you to find your numbers in large bank of numbers.
No comments:
Post a Comment