package dublicatsacanner;
import java.util.Scanner;
public class Dublicatsacanner {
/**S
* @param args the command line arguments
*/
public static void main(String[] args) {
String names[]=new String[5];
Scanner sc=new Scanner(System.in);
System.out.println("enter strings");
for(int i=0;i<5;i++){
names[i]=sc.next();
}
for(int i=0;i<5;i++){
for(int j=i+1;j<5;j++){
if(names[i].equals(names[j])){
System.out.println("this is dublicate::"+names[i]);
}
}
}
}
}
No comments:
Post a Comment