0% found this document useful (0 votes)
42 views

2.WAPT Transpose A DDA and Print It

The document contains code for a Java program that transposes a 3x3 double dimension array (DDA) and prints the original and transposed arrays. It defines classes for input/output, accepts user input to populate the original array, copies values to transpose into a new array, and includes methods to display the original and transposed arrays.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

2.WAPT Transpose A DDA and Print It

The document contains code for a Java program that transposes a 3x3 double dimension array (DDA) and prints the original and transposed arrays. It defines classes for input/output, accepts user input to populate the original array, copies values to transpose into a new array, and includes methods to display the original and transposed arrays.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

KARTIK V / 11A / 11122

2.WAPT transpose a DDA and print it. import java.io.* ;


class transpose { InputStreamReader reader=new InputStreamReader(System.in); BufferedReader input=new BufferedReader(reader); String text; int a[][]=new int[3][3]; int b[][]=new int[3][3]; void accept()throws IOException { for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { text=input.readLine(); a[i][j]=Integer.parseInt(text); }}} void transposing() { for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { b[i][j]=a[j][i]; }}} void display1() { System.out.println("ORIGNINAL ARRAY :"); KARTIK V / 11A / 11122

KARTIK V / 11A / 11122 for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { System.out.print(a[i][j]+" "); } System.out.println(); }} void display2() { System.out.println("TRANSPOSE ARRAY :"); for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { System.out.print(b[i][j]+" "); } System.out.println(); }} public static void main()throws IOException { transpose obj=new transpose(); obj.accept(); obj.transposing(); obj.display1(); obj.display2(); }}//end of class OUTPUT :

KARTIK V / 11A / 11122

You might also like