Question: 4. What does the following segment of Java code do? Try figuring it out just from reading the code, then plug it into Netbeans and
4. What does the following segment of Java code do? Try figuring it out just from reading the code, then plug it into Netbeans and see if you were correct. If not, write out your explanation. Scanner stdin = new Scanner (System.in); System.out.println("Enter n."); int n = stdin.nextInt(); int total = 0; while (n > 0) { total - total + n$10; n = n/10; I } System.out.println(total)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
