Question: What does this print in java? public class Main { } public static void main(String args[]) { int n = -1, x = 10; while(n

What does this print in java?


public class Main { } public static void main(String args[]) { int 

public class Main { } public static void main(String args[]) { int n = -1, x = 10; while(n >= -1 && n*x < 5) { n = n + 1; System.out.print(n); System.out.print("DONE"); } }

Step by Step Solution

3.45 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This Java program contains a main method that performs a loop and prints the values of n until the c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!