String[] letters={"GHI","VWX","YZ&", 'JKL","MNO","ABC","STO","DEF","PQR"}; int n = 0; for (int i = letters.length-3; i > 0; i--) { System.out.printf("%s\n", letters[i].charAt (n++)) ; if(n > 2) n = 0; int[] array = {12,9,1,2,11,8,10,7,3}; System.out.println(array[array[3]-array[2]]*4);

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question
100%

Trace the following pieces of code and give their exact output and the tracing steps.

String[] letters={"GHI","VWX",
"YZ&",
"JKL","MNO","ABC",
"STO",
"DEF","PQR"};
int n = 0;
for (int i =
letters.length-3; i > 0; i--) {
System.out.printf("%s\n", letters [i].charAt(n++));
if(n > 2) n = 0;
}
int[] array
{12,9,1,2,11,8,10,7,3};
System.out.println(array[array[3]-array[2]]*4);
Transcribed Image Text:String[] letters={"GHI","VWX", "YZ&", "JKL","MNO","ABC", "STO", "DEF","PQR"}; int n = 0; for (int i = letters.length-3; i > 0; i--) { System.out.printf("%s\n", letters [i].charAt(n++)); if(n > 2) n = 0; } int[] array {12,9,1,2,11,8,10,7,3}; System.out.println(array[array[3]-array[2]]*4);
Expert Solution
steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Knowledge Booster
Matrix multiplication
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT