What is wrong with this loop? How would you fix it?


int num = 1;
while (num <= 10 ) {
System.out.println("num = " + num);
}


It is an infinite loop. After the print statement, we need to increment num, as in the statement num++; .

Computer Science & Information Technology

You might also like to view...

Which of the following SQL statements will return only the student name and GPA from the Student table for all students having a GPA that is greater than or equal to 3.5?



a. SELECT Name, GPA FROM Student WHERE GPA >=3.5
b. SELECT * FROM Student WHERE GPA >= 3.5
c. SELECT Name, Number, GPA, CumHrs FROM Student WHERE GPA >= 3.5
d. SELECT Student WHERE GPA >= 3.5 And Name, GPA

Computer Science & Information Technology

How would you achieve the same effect in Fractal?

What will be an ideal response?

Computer Science & Information Technology

To open the Format Chart Area task pane, right-click the chart border, and then select ________

A) Chart Properties B) Format Chart Area C) Format Properties D) Chart Formatting dialog box

Computer Science & Information Technology

You can create at most one Excel table in a worksheet.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology