JAVA_CODINGS Telegram 68
48. Create & Display Matrix.

import java.util.Scanner;

class Matrix_Create {

Scanner scan;
int matrix[][];
int row, column;

void create() {

scan = new Scanner(System.in);

System.out.println("Matrix Creation");

System.out.println("\nEnter number of rows :");
row = Integer.parseInt(scan.nextLine());

System.out.println("Enter number of columns :");
column = Integer.parseInt(scan.nextLine());

matrix = new int[row][column];
System.out.println("Enter the data :");

for(int i=0; i<row ; i++) {

for(int j=0; j
<column ; j++) {

matrix[i][j] =scan.nextInt();
}
}
}

void display() {

System.out.println("\nThe Matrix is :");

for(int i=0; i <row ; i++) {

for(int j=0; j <column ; j++) {

System.out.print("\t" + matrix[i][j]);
}
System.out.println();
}
}
}

class CreateAndDisplayMatrix {

public static void main(String
args[]) {

Matrix_Create obj=new Matrix_Create();

obj.create();
obj.display();
}
}

@java_codings



tgoop.com/java_codings/68
Create:
Last Update:

48. Create & Display Matrix.

import java.util.Scanner;

class Matrix_Create {

Scanner scan;
int matrix[][];
int row, column;

void create() {

scan = new Scanner(System.in);

System.out.println("Matrix Creation");

System.out.println("\nEnter number of rows :");
row = Integer.parseInt(scan.nextLine());

System.out.println("Enter number of columns :");
column = Integer.parseInt(scan.nextLine());

matrix = new int[row][column];
System.out.println("Enter the data :");

for(int i=0; i<row ; i++) {

for(int j=0; j
<column ; j++) {

matrix[i][j] =scan.nextInt();
}
}
}

void display() {

System.out.println("\nThe Matrix is :");

for(int i=0; i <row ; i++) {

for(int j=0; j <column ; j++) {

System.out.print("\t" + matrix[i][j]);
}
System.out.println();
}
}
}

class CreateAndDisplayMatrix {

public static void main(String
args[]) {

Matrix_Create obj=new Matrix_Create();

obj.create();
obj.display();
}
}

@java_codings

BY Advance Java πŸ‘¨β€πŸ’»


Share with your friend now:
tgoop.com/java_codings/68

View MORE
Open in Telegram


Telegram News

Date: |

Telegram iOS app: In the β€œChats” tab, click the new message icon in the right upper corner. Select β€œNew Channel.” Add the logo from your device. Adjust the visible area of your image. Congratulations! Now your Telegram channel has a face Click β€œSave”.! Click β€œSave” ; The public channel had more than 109,000 subscribers, Judge Hui said. Ng had the power to remove or amend the messages in the channel, but he β€œallowed them to exist.” Unlimited number of subscribers per channel
from us


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM American