Display the integers from 1 to 20 using a while loop and the counter variable i. Assume that the variable i has been declared, but not initialized. Display only five integers per line. [Hint: Use the calculation i % 5. When the value of this expression is 0, display a newline character; otherwise, display a tab character. Use the Console.WriteLine() method to output the newline character, and use the Console.Write('\t') method to output the tab character.]

What will be an ideal response?

```
i = 1;
while (i <= 20)
{
Console.Write(i);
if (i % 5 == 0)
{
Console.WriteLine();
}
else
{
Console.Write('\t');
}
++i;
}
```

Computer Science & Information Technology

You might also like to view...

How many project processes exist within the ISO/IEC 12207-2008 standard?

A. 4 B. 5 C. 6 D. 7

Computer Science & Information Technology

Every Flash document starts with one scene.

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

Computer Science & Information Technology