Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class findArray{
- public static void main(String args[]){
- int[][] arrayOfInts = {{ 32, 87, 3, 589 }, { 12, 1076, 2000, 8 },{ 622, 127, 77, 955 }};
- Scanner in = new Scanner(System.in);
- int ketemu;
- ketemu = 0;
- System.out.print("Input the value\t: ");int cari = in.nextInt();
- for(int x=0; x<3;x++){
- for(int y=0; y<4;y++){
- if(cari == arrayOfInts[x][y]){
- System.out.println("Found "+cari+ " at "+x+" , " +y);
- ketemu=1;
- }
- }
- }
- if(ketemu==0){
- System.out.println(cari+" Not Found!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment