Saturday, 18 July 2015

SIMPLE PROGRAMME TO CHECK THAT THE GIVEN NUMBERS IS PRESENT IN THE LIST OR NOT.

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.

No comments:

Post a Comment