
Explanation of Solution
Given: The lines of Java code:
int n, m;
for (n = 1; n <= 10; n++)
for (m = 10; m >= 1; m--)
System.out.println(n + " times " + m+ " = " + n*m);
To find: The output of the lines of code in Java language and comment on the code:
int n, m;
for (n = 1; n <= 10; n++)
for (m = 10; m >= 1; m--)
System.out.println(n + " times " + m+ " = " + n*m);
Solution:
In this code:
Two variables, m and n, are declared.
In the outer for loop, the variable n will increment from 1 to 10 in ascending order and variable m in the inner for loop will decrement from 10 to 1.
In the outer loop, the value of n iterates from 1 and gets incremented by 1 if n<=10.
Then, it moves to the inner loop in which the value of m iterates from 10 and gets decremented by 1 till m>=1.
For every value of n, the inner loop repeats itself till the condition of m>=1 is satisfied and it executes the print statement for every value of m...

Want to see the full answer?
Check out a sample textbook solution
Chapter 3 Solutions
Absolute Java (6th Edition)
- I need help in explaining how I can demonstrate how the Laplace & Inverse transformations behaves in MATLAB transformation (ex: LIke in graph or something else)arrow_forwardYou have made the Web solution with Node.js. please let me know what problems and benefits I would experience while making the Web solution here, as compared to any other Web solution you have developed in the past. what problems and benefits/things to keep in mind as someone just learningarrow_forwardPHP is the server-side scripting language. MySQL is used with PHP to store all the data. EXPLAIN in details how to install and run the PHP/MySQL on your computer. List the issues and challenges I may encounter while making this set-up? why I asked: I currently have issues logging into http://localhost/phpmyadmin/ and I tried using the command prompt in administrator to reset the password but I got the error LOCALHOST PORT not found.arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning




