Find the error in the code segments, and explain how to correct it:

The following code should print the values 1 to 10:
```
n = 1;
while (n < 10) {
System.out.println(n++);
}
```


Error: An improper relational operator is used in the while’s continuation condition.
Correction: Use <= rather than <, or change 10 to 11.

Computer Science & Information Technology

You might also like to view...

A software package that includes a text editor, compiler, debugger, and assorted utilities for creating, testing, and running software is called

A) a low-level programming language. B) a high-level programming language. C) a software utility package (SUP). D) an operating system. E) none of the above.

Computer Science & Information Technology

____ is a language like SGML used to create markup languages but without SGML's complexity and size.

A. XML B. XHTML C. HTML D. XSL

Computer Science & Information Technology

Replace Font is an option that appears when the ________ arrow is clicked on the Home tab

Fill in the blank(s) with correct word

Computer Science & Information Technology

What type of LCD panels on monitors produce better color reproduction at a wider range of viewing angles, but slightly worse response times?

A. TFT B. TN C. CCFL D. IPS

Computer Science & Information Technology