SlideShare una empresa de Scribd logo
1 de 4
Please help in Java
1. Declare and initialize the 2 dimensional array a b c d e f g h i Next print one diagonal of this
"determinant" on one line , and then the other diagonal, separated by a line from the first
diagonal you printed. 2. Generate the two-dimensional string array: Roses are red Violets are
blue I've never found someone as patient As you Substitute "but I have commitment issues" for
the last line in the above poem and print the whole poem.
Solution
/*Java program to print diagonals of character array and print lines of poem..*/
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class diagArr
{
public static void main (String[] args) throws java.lang.Exception
{
// initializing two dimensional array
char[][] arr1 = { {'a', 'b','c'}, {'d', 'e','f'}, {'g', 'h','i'} };
System.out.println("Printing diagonals...");
System.out.println(arr1[0][0]+" t"+arr1[1][1]+"t"+arr1[2][2]);
System.out.println(" ");
System.out.println(arr1[0][2]+"t"+arr1[1][1]+"t"+arr1[2][0]);
System.out.println(" ");
// initializing second two dimensional array
//String[][] arr2 = { {"Roses", "are","Red"}, {"Violets", "are","Blue"}, {" Ive",
"never","found"},{"someone", "as", "patient"},{"As","you","" }};
// initializing second two dimensional array
String[][] arr2 = new String[6][3];
arr2[0][0] = "Roses";
arr2[0][1] = "are";
arr2[0][2] = "Red";
arr2[1][0] = "Violets";
arr2[1][1] = "are";
arr2[1][2] = "Blue";
arr2[2][0] = "Ive";
arr2[2][1] = "never";
arr2[2][2] = "found";
arr2[3][0] = "someone";
arr2[3][1] = "as";
arr2[3][2] = "patient";
arr2[4][0] = "as";
arr2[4][1] = "you";
System.out.println("Printing poem...");
arr2[4][0]="but";
arr2[4][1]="I";
arr2[4][2]="have";
arr2[5][0]="commitment";
arr2[5][1]="issues";
arr2[5][2]=" ";
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 3; j++) {
System.out.println(arr2[i][j]+"t");
}
System.out.println(" ");
}//second for loop ends
}//main ends
}//class ends
Output:
Printing diagonals...
a   e  i
c  e  g
Printing poem...
Roses
are
Red
Violets
are
Blue
Ive
never
found
someone
as
patient
but
I
have
commitment
issues
Please help in Java 1- Declare and initialize the 2 dimensional array.docx

Más contenido relacionado

Más de rtodd19

Please answer part c of the question- Thank you- The International Ato.docx
Please answer part c of the question- Thank you- The International Ato.docxPlease answer part c of the question- Thank you- The International Ato.docx
Please answer part c of the question- Thank you- The International Ato.docxrtodd19
 
Pictorialize a human being as a computer system-SolutionThe human nerv.docx
Pictorialize a human being as a computer system-SolutionThe human nerv.docxPictorialize a human being as a computer system-SolutionThe human nerv.docx
Pictorialize a human being as a computer system-SolutionThe human nerv.docxrtodd19
 
Personal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docx
Personal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docxPersonal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docx
Personal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docxrtodd19
 
Peruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docx
Peruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docxPeruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docx
Peruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docxrtodd19
 
Why do some authors view investment cash flow sensitivity as a symptom.docx
Why do some authors view investment cash flow sensitivity as a symptom.docxWhy do some authors view investment cash flow sensitivity as a symptom.docx
Why do some authors view investment cash flow sensitivity as a symptom.docxrtodd19
 
Why do some converging technologies raise special ethical and social i.docx
Why do some converging technologies raise special ethical and social i.docxWhy do some converging technologies raise special ethical and social i.docx
Why do some converging technologies raise special ethical and social i.docxrtodd19
 
Why do the outer stars in our galaxy not slow down- as Keplers laws of.docx
Why do the outer stars in our galaxy not slow down- as Keplers laws of.docxWhy do the outer stars in our galaxy not slow down- as Keplers laws of.docx
Why do the outer stars in our galaxy not slow down- as Keplers laws of.docxrtodd19
 
Why are concentrated interests and diffuse costs important in predicti.docx
Why are concentrated interests and diffuse costs important in predicti.docxWhy are concentrated interests and diffuse costs important in predicti.docx
Why are concentrated interests and diffuse costs important in predicti.docxrtodd19
 
Who are organizational stakeholders and what types of responsibilities.docx
Who are organizational stakeholders and what types of responsibilities.docxWho are organizational stakeholders and what types of responsibilities.docx
Who are organizational stakeholders and what types of responsibilities.docxrtodd19
 
Who are the principle stake holders of the company- Did Dole treat the.docx
Who are the principle stake holders of the company- Did Dole treat the.docxWho are the principle stake holders of the company- Did Dole treat the.docx
Who are the principle stake holders of the company- Did Dole treat the.docxrtodd19
 
Which type of network covers a contiguous geographic area- such as an.docx
Which type of network covers a contiguous geographic area- such as an.docxWhich type of network covers a contiguous geographic area- such as an.docx
Which type of network covers a contiguous geographic area- such as an.docxrtodd19
 
Which space is the most abundant in 1-0 M of wak acid HCN solution- As.docx
Which space is the most abundant in 1-0 M of wak acid HCN solution- As.docxWhich space is the most abundant in 1-0 M of wak acid HCN solution- As.docx
Which space is the most abundant in 1-0 M of wak acid HCN solution- As.docxrtodd19
 
which sectors might constitute the critical infrastructures of turkey.docx
which sectors might constitute the critical infrastructures of turkey.docxwhich sectors might constitute the critical infrastructures of turkey.docx
which sectors might constitute the critical infrastructures of turkey.docxrtodd19
 
Which one of the following statements is true- Only one is true- Expla.docx
Which one of the following statements is true- Only one is true- Expla.docxWhich one of the following statements is true- Only one is true- Expla.docx
Which one of the following statements is true- Only one is true- Expla.docxrtodd19
 
Which one of the following below would not be classified as an operati.docx
Which one of the following below would not be classified as an operati.docxWhich one of the following below would not be classified as an operati.docx
Which one of the following below would not be classified as an operati.docxrtodd19
 
Which of the two main types of reactor design are the following- What.docx
Which of the two main types of reactor design are the following- What.docxWhich of the two main types of reactor design are the following- What.docx
Which of the two main types of reactor design are the following- What.docxrtodd19
 
Which of the responses includes all of the following that can form hyd.docx
Which of the responses includes all of the following that can form hyd.docxWhich of the responses includes all of the following that can form hyd.docx
Which of the responses includes all of the following that can form hyd.docxrtodd19
 
Which of the four operations on functions do you think is the easiest.docx
Which of the four operations on functions do you think is the easiest.docxWhich of the four operations on functions do you think is the easiest.docx
Which of the four operations on functions do you think is the easiest.docxrtodd19
 
Which of the following would not appear in an IT acceptable use policy.docx
Which of the following would not appear in an IT acceptable use policy.docxWhich of the following would not appear in an IT acceptable use policy.docx
Which of the following would not appear in an IT acceptable use policy.docxrtodd19
 
Which of the following would be soluable in water- Benzene C6H6 Diethy.docx
Which of the following would be soluable in water- Benzene C6H6 Diethy.docxWhich of the following would be soluable in water- Benzene C6H6 Diethy.docx
Which of the following would be soluable in water- Benzene C6H6 Diethy.docxrtodd19
 

Más de rtodd19 (20)

Please answer part c of the question- Thank you- The International Ato.docx
Please answer part c of the question- Thank you- The International Ato.docxPlease answer part c of the question- Thank you- The International Ato.docx
Please answer part c of the question- Thank you- The International Ato.docx
 
Pictorialize a human being as a computer system-SolutionThe human nerv.docx
Pictorialize a human being as a computer system-SolutionThe human nerv.docxPictorialize a human being as a computer system-SolutionThe human nerv.docx
Pictorialize a human being as a computer system-SolutionThe human nerv.docx
 
Personal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docx
Personal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docxPersonal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docx
Personal Trainer- Inc- owns and operates fitness centers in a dozen Mi.docx
 
Peruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docx
Peruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docxPeruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docx
Peruse the readings by Bennis and Nanus- Schein- and Ulrich and Lake-.docx
 
Why do some authors view investment cash flow sensitivity as a symptom.docx
Why do some authors view investment cash flow sensitivity as a symptom.docxWhy do some authors view investment cash flow sensitivity as a symptom.docx
Why do some authors view investment cash flow sensitivity as a symptom.docx
 
Why do some converging technologies raise special ethical and social i.docx
Why do some converging technologies raise special ethical and social i.docxWhy do some converging technologies raise special ethical and social i.docx
Why do some converging technologies raise special ethical and social i.docx
 
Why do the outer stars in our galaxy not slow down- as Keplers laws of.docx
Why do the outer stars in our galaxy not slow down- as Keplers laws of.docxWhy do the outer stars in our galaxy not slow down- as Keplers laws of.docx
Why do the outer stars in our galaxy not slow down- as Keplers laws of.docx
 
Why are concentrated interests and diffuse costs important in predicti.docx
Why are concentrated interests and diffuse costs important in predicti.docxWhy are concentrated interests and diffuse costs important in predicti.docx
Why are concentrated interests and diffuse costs important in predicti.docx
 
Who are organizational stakeholders and what types of responsibilities.docx
Who are organizational stakeholders and what types of responsibilities.docxWho are organizational stakeholders and what types of responsibilities.docx
Who are organizational stakeholders and what types of responsibilities.docx
 
Who are the principle stake holders of the company- Did Dole treat the.docx
Who are the principle stake holders of the company- Did Dole treat the.docxWho are the principle stake holders of the company- Did Dole treat the.docx
Who are the principle stake holders of the company- Did Dole treat the.docx
 
Which type of network covers a contiguous geographic area- such as an.docx
Which type of network covers a contiguous geographic area- such as an.docxWhich type of network covers a contiguous geographic area- such as an.docx
Which type of network covers a contiguous geographic area- such as an.docx
 
Which space is the most abundant in 1-0 M of wak acid HCN solution- As.docx
Which space is the most abundant in 1-0 M of wak acid HCN solution- As.docxWhich space is the most abundant in 1-0 M of wak acid HCN solution- As.docx
Which space is the most abundant in 1-0 M of wak acid HCN solution- As.docx
 
which sectors might constitute the critical infrastructures of turkey.docx
which sectors might constitute the critical infrastructures of turkey.docxwhich sectors might constitute the critical infrastructures of turkey.docx
which sectors might constitute the critical infrastructures of turkey.docx
 
Which one of the following statements is true- Only one is true- Expla.docx
Which one of the following statements is true- Only one is true- Expla.docxWhich one of the following statements is true- Only one is true- Expla.docx
Which one of the following statements is true- Only one is true- Expla.docx
 
Which one of the following below would not be classified as an operati.docx
Which one of the following below would not be classified as an operati.docxWhich one of the following below would not be classified as an operati.docx
Which one of the following below would not be classified as an operati.docx
 
Which of the two main types of reactor design are the following- What.docx
Which of the two main types of reactor design are the following- What.docxWhich of the two main types of reactor design are the following- What.docx
Which of the two main types of reactor design are the following- What.docx
 
Which of the responses includes all of the following that can form hyd.docx
Which of the responses includes all of the following that can form hyd.docxWhich of the responses includes all of the following that can form hyd.docx
Which of the responses includes all of the following that can form hyd.docx
 
Which of the four operations on functions do you think is the easiest.docx
Which of the four operations on functions do you think is the easiest.docxWhich of the four operations on functions do you think is the easiest.docx
Which of the four operations on functions do you think is the easiest.docx
 
Which of the following would not appear in an IT acceptable use policy.docx
Which of the following would not appear in an IT acceptable use policy.docxWhich of the following would not appear in an IT acceptable use policy.docx
Which of the following would not appear in an IT acceptable use policy.docx
 
Which of the following would be soluable in water- Benzene C6H6 Diethy.docx
Which of the following would be soluable in water- Benzene C6H6 Diethy.docxWhich of the following would be soluable in water- Benzene C6H6 Diethy.docx
Which of the following would be soluable in water- Benzene C6H6 Diethy.docx
 

Último

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 

Último (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 

Please help in Java 1- Declare and initialize the 2 dimensional array.docx

  • 1. Please help in Java 1. Declare and initialize the 2 dimensional array a b c d e f g h i Next print one diagonal of this "determinant" on one line , and then the other diagonal, separated by a line from the first diagonal you printed. 2. Generate the two-dimensional string array: Roses are red Violets are blue I've never found someone as patient As you Substitute "but I have commitment issues" for the last line in the above poem and print the whole poem. Solution /*Java program to print diagonals of character array and print lines of poem..*/ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class diagArr { public static void main (String[] args) throws java.lang.Exception { // initializing two dimensional array char[][] arr1 = { {'a', 'b','c'}, {'d', 'e','f'}, {'g', 'h','i'} }; System.out.println("Printing diagonals..."); System.out.println(arr1[0][0]+" t"+arr1[1][1]+"t"+arr1[2][2]); System.out.println(" "); System.out.println(arr1[0][2]+"t"+arr1[1][1]+"t"+arr1[2][0]); System.out.println(" ");
  • 2. // initializing second two dimensional array //String[][] arr2 = { {"Roses", "are","Red"}, {"Violets", "are","Blue"}, {" Ive", "never","found"},{"someone", "as", "patient"},{"As","you","" }}; // initializing second two dimensional array String[][] arr2 = new String[6][3]; arr2[0][0] = "Roses"; arr2[0][1] = "are"; arr2[0][2] = "Red"; arr2[1][0] = "Violets"; arr2[1][1] = "are"; arr2[1][2] = "Blue"; arr2[2][0] = "Ive"; arr2[2][1] = "never"; arr2[2][2] = "found"; arr2[3][0] = "someone"; arr2[3][1] = "as"; arr2[3][2] = "patient"; arr2[4][0] = "as"; arr2[4][1] = "you"; System.out.println("Printing poem..."); arr2[4][0]="but"; arr2[4][1]="I"; arr2[4][2]="have"; arr2[5][0]="commitment"; arr2[5][1]="issues"; arr2[5][2]=" "; for (int i = 0; i < 6; i++) { for (int j = 0; j < 3; j++) { System.out.println(arr2[i][j]+"t"); } System.out.println(" "); }//second for loop ends }//main ends }//class ends Output:
  • 3. Printing diagonals... a   e  i c  e  g Printing poem... Roses are Red Violets are Blue Ive never found someone as patient but I have commitment issues