Question #221027

The manager has decided to provide the party to their employees in the restaurant at week end due to his wedding anniversary. He wants to know the number of participants to arrange a dinner. During the dinner, he wants to conduct a game by calling employees who are having similar name. Design a java program to Read the list of employee names using an array. Arrange in N rows, M columns seating arrangements. Find the similar names without considering the alphabet case.

Expert's answer

import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
	    int M,N;
	    Scanner in=new Scanner(System.in);
	    M=in.nextInt();
	    N=in.nextInt();
	    int[][] arr = new int[M][N];
	    
		for (int i = 0; i < M; i++) {
            for (int j = 0; j < N; j++) {
                arr[i][j]=in.nextInt();
            }
	    }
	    for (int i = 0; i < M; i++) {
            for (int j = 0; j < N; j++) {
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
	    }
	}
}

LATEST TUTORIALS
APPROVED BY CLIENTS