Java Bangla Tutorials 77 : Array | Matrix Part-2

preview_player
Показать описание
➡️ In this video, I will show how to create a matrix with a 2d array.
⭐️ Video Contents ⭐️
⌨️ (00:00) Intro
⌨️ (00:11) Two-dimensional array
⌨️ (08:50) outro

🛑 Web development? Checkout following playlists :

🛑 Programming languages? Check out the following playlists:

🛑 Android development? Check out the following playlists:

🛑 HSC Students? Are you worried about ICT? I have created 377 videos for you. check out the following playlists-

🛑 CSE Students? Checkout following playlists :

🛑 MS Office? Trying to learn MS office to improve your skill? Checkout following playlists :

#java #anisul_islam #java_bangla_tutorial #web_development #bangla_web_development #andorid #javaprogramming #javatutorial #bangla_tutorial #java_anisul_islam
Рекомендации по теме
Комментарии
Автор

জাভা কোর্স করার সময় যদি আমি আপনার মত একজন শিক্ষক পেতাম, তবে কোর্স শেষ করার পর কনসেপ্ট বুঝার জন্য পুনরায় আমার ইউটউবে আসতে হইতো না।
Thanks a lot,
you are great,
I hope Allah will make you successful.

Pray for me .

abdullahmasud
Автор

You are a great Bangladeshi programmer brother... Love you. ❤️❤️❤️

nsanoman
Автор

জাভা কোর্স করার সময় যদি আমি আপনার মত একজন শিক্ষক পেতাম, তবে কোর্স শেষ করার পর কনসেপ্ট বুঝার জন্য পুনরায় আমার ইউটউবে আসতে হইতো না।
Thanks a lot,
you are great,
I hope Allah will make you successful.(2)

almuzahid
Автор

exceptional explanation. Thank you Anisul vai for giving us such a very knowledgeable video series in Bangla.

MDHOSSAIN-gjve
Автор

Thank you sir.this best tutorial of Java

mdrakibul-gifn
Автор

I am trying to watch all of your videos....

nsanoman
Автор

I did everything using input (including the summation):

package Array1;

import java.util.Scanner;

public class Array2DDemo {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n, m, o, p, q, r;
System.out.print("Enter array length for row: ");
n = input.nextInt();
System.out.print("Enter array length for col: ");
m = input.nextInt();

int[][] A = new int[n][m];

System.out.println("");
System.out.print("Enter array length for row1: ");
o = input.nextInt();
System.out.print("Enter array length for col1: ");
p = input.nextInt();

int[][] B = new int[o][p];

//Taking A matrix input
System.out.println("");
System.out.println("Enter elements for A metrix:");
for (int row = 0; row < n; row++) {
for (int col = 0; col < m; col++) {
System.out.printf("A[%d][%d] = ", row, col);
A[row][col] = input.nextInt();
}
}

//Taking A matrix input
System.out.println("Enter elements for B metrix:");
for (int row = 0; row < o; row++) {
for (int col = 0; col < p; col++) {
System.out.printf("B[%d][%d] = ", row, col);
B[row][col] = input.nextInt();
}
}
//Printing the B matrix
System.out.println("");
System.out.print("A = ");
for (int row = 0; row < n; row++) {
for (int col = 0; col < m; col++) {

}
System.out.println();
}
//Printing the B matrix
System.out.println("");
System.out.print("B = ");
for (int row = 0; row < o; row++) {
for (int col = 0; col < p; col++) {

}
System.out.println();
}

//Taking array length for the sum
System.out.println("");
System.out.print("Enter summation array length for row: ");
q = input.nextInt();
System.out.print("Enter summation array length for col: ");
r = input.nextInt();

int[][] C = new int[q][r];
//Sum of A+B
System.out.println("");

System.out.print("A+B = ");
for (int row = 0; row < q; row++) {
for (int col = 0; col < r; col++) {
C[row][col] = (A[row][col]+B[row][col]);

}

System.out.println();
}

}
}

shakilahmed
Автор

package Array;

import java.util.Scanner;


public class MatrixSum {
public static void main(String[] args) {
Scanner ad = new Scanner(System.in);
int a[][]=new int[2][3];
int b[][]=new int[2][3];
System.out.print("Enter matrix a: ");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
a[i][j]=ad.nextInt();
}
}
System.out.println("a= ");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(a[i][j]+" ");
}
System.out.println();
}
System.out.print("Enter matrix b: ");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
b[i][j]=ad.nextInt();
}
}
System.out.println("b= ");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(b[i][j]+" ");
}
System.out.println();
}
System.out.println("\na+b= ");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
");
}
System.out.println();
}
}
}

mhs_
Автор

package array_learning;

import java.util.Scanner;


public class Matrixpart1 {

public static void main(String[] args) {

Scanner input=new Scanner(System.in);

int[][] A=new int[2][3];
int[][] B=new int[2][3];


//for taking element of A matrix
for (int row1 = 0; row1 < 2; row1++) {

for (int col1 = 0; col1 < 3; col1++) {

System.out.printf("A[%d][%d]= ", row1, col1);


}

}

//for taking element of B matrix
for (int row2 = 0; row2 < 2; row2++) {

for (int col2 = 0; col2 < 3; col2++) {
System.out.printf("B[%d][%d]= ", row2, col2);


}

}



//Printing A matrix
System.out.println("A= ");
for (int row1 = 0; row1 < 2; row1++) {

for (int col1 = 0; col1 < 3; col1++) {

System.out.print("\t "+A[row1][col1]);

}
System.out.println("\n\n");
}


//Printing B matrix
System.out.println("B= ");
for (int row2 = 0; row2 < 2; row2++) {

for (int col2 = 0; col2 < 3; col2++) {

System.out.print("\t "+B[row2][col2]);

}
System.out.println("\n\n");
}



//Adding Matrix A &B
System.out.print("A+B= ");
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
System.out.print("\t "+(A[i][j] + B[i][j]));


}
System.out.println();
}





}



}

susmita
Автор

package classofarray;

import java.util.Scanner;

public class ArrayMatrixOne {

public static void main(String[] args) {
int[][] A = new int[2][3];
int[][] B = new int[2][3];
int[][] C = new int[2][3];
Scanner input = new Scanner(System.in);
System.out.println("Enter number for A matrix : ");

int row, col;
for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.printf("A[%d][%d] = ", row, col);
A[row][col] = input.nextInt();

}
}
System.out.println("\n\n");
System.out.println("A = ");

for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.print("\t" + A[row][col]);

}
System.out.println("");
}
System.out.println("Enter number for B matrix : ");
for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.printf("B[%d][%d] = ", row, col);
B[row][col] = input.nextInt();

}
}
System.out.println("\n\n");
System.out.println("B = ");

for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
System.out.print("\t" + B[row][col]);

}
System.out.println("");

}
System.out.println("\n\n");
System.out.println("A+B = ");

for (row = 0; row < 2; row++) {
for (col = 0; col < 3; col++) {
C[row][col] = A[row][col] + B[row][col];
System.out.print("\t" + C[row][col]);

}
System.out.println("");

}

}

}

elorabarua
Автор

Vay amar vulta kothai bujte parlam na, successful dekhai but result view kore na?

package basicjava;

import java.util.Scanner;


public class Java2d {
public static void main(String[] args) {
System.out.println("Enter 2 Dimensional Array");
Scanner input=new Scanner(System.in);
int [][]A=new int[2][3];
int [][]B=new int[2][3];

// A matrix;
for(int row=0;row>2;row++){
for(int col=0;col>3;col++){
System.out.printf("A[%d][%d]= ", row, col);
A[row][col]=input.nextInt();

}
}
// B matrix
for(int row=0;row>2;row++){
for(int col=0;col>3;col++){
System.out.printf("B[%d][%d]= ", row, col);
A[row][col]=input.nextInt();

}

}
//print A matrix
for(int row=0;row>2;row++){
for(int col=0;col>3;col++){
System.out.print("= "+A[row][col]);
}
System.out.println("\t");
}
//print B matrix
for(int row=0;row>2;row++){
for(int col=0;col>3;col++){
System.out.print("= "+B[row][col]);
}
System.out.println("\t");
}
}
}

hasanurrahman
Автор

package array_demo;

import java.util.Scanner;

public class Array5 {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int[][] A = new int[2][3];
int[][] B = new int[2][3];
int[][] C = new int[2][3];


// getting input for A matrix
System.out.print("Enter elements for A matrix : ");
for (int row =0; row < 2; row++){
for (int col =0; col < 3; col++){
System.out.printf("A[%d][%d] = ", row, col );
A[row][col] = input.nextInt();
}
}


// getting input for B matrix
System.out.print("Enter elements for B matrix : ");
for (int row =0; row < 2; row++){
for (int col =0; col < 3; col++){
System.out.printf("B[%d][%d] = ", row, col);
B[row][col] = input.nextInt();
}
}



// Printing for A matrix
System.out.print("A = ");
for (int row =0; row < 2; row++){
for (int col =0; col < 3; col++){
System.out.print("\t "+ A[row][col]);
}
System.out.println();
}




System.out.println("\n\n");
// Printing for B matrix
System.out.print("B = ");
for (int row =0; row < 2; row++){
for (int col =0; col < 3; col++){
System.out.print("\t "+B[row][col]);
}
System.out.println();
}





System.out.println("\n\n");
// adding A and B Matrix
System.out.print("A+B = ");
for (int row = 0; row < 2; row++){
for (int col = 0; col < 3; col++){

C[row][col]=A[row][col] + B[row][col];
System.out.print("\t "+ C[row][col]);
// System.out.print("\t " +(A[row][col] + B[row][col]));

}
System.out.println();
}






System.out.println("\n\n");
// Subtract A and B Matrix
System.out.print("A-B = ");
for (int row = 0; row < 2; row++){
for (int col = 0; col < 3; col++){

C[row][col]=A[row][col] - B[row][col];
System.out.print("\t "+ C[row][col]);
// System.out.print("\t " +(A[row][col] + B[row][col]));

}
System.out.println();
}

}

}

MDIQBALHOSSAIN-op
Автор

import java.util.Scanner;

public class {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

: For addition and subtracton of thwo matrices, the rows and columns og the two matricers must be equal ***\n");

System.out.print("Enter size of row of the matrix : ");
int m = input.nextInt();
System.out.print("Enter size of column of the matrix :");
int n = input.nextInt();

int[][] matrix1 = new int[m][n];
int [][] matrix2 = new int[m][n];


System.out.printf("please Matrix A :\n");

for(int row =0 ; row<m ; row++){
for(int col =0; col<n; col++){
System.out.printf("A[%d][%d] : ", row, col);
matrix1[row][col] = input.nextInt();
}
}
System.out.printf("please Matrix B :\n");

for(int row =0 ; row<m ; row++){
for(int col =0; col<n; col++){
System.out.printf("A[%d][%d] : ", row, col);
matrix2[row][col] = input.nextInt();
}
}

System.out.println("\nMatrix A :\n");
for(int row =0 ; row<m ; row++){
for(int col =0; col<n; col++){
System.out.print("\t"+ matrix1[row][col]);

}
System.out.println();
}
System.out.println("\nMatrix B :\n");
for(int row =0 ; row<m ; row++){
for(int col =0; col<n; col++){
System.out.print("\t"+ matrix2[row][col]);

}
System.out.println();
}

System.out.println("\nA+B :\n");
for(int row =0 ; row<m ; row++){
for(int col =0; col<n; col++){
System.out.print("\t"+

}
System.out.println();
}
System.out.println("\nA-B :\n");
for(int row =0 ; row<m ; row++){
for(int col =0; col<n; col++){
System.out.print("\t"+

}
System.out.println();
}

}

}

hassanshuvo
Автор

এখানে যোগ করার সময় লুটপা ব্যবহার না করে যোগ করা যেতো না

mohammadsalman
visit shbcf.ru