Easy Multiple Choice QuestionsΒΆ

These problems are easier than most of those that you will usually see on the AP CS A exam.

6-6-1: What does the following code print?

for (int i = 3; i <= 12; i++)
{
   System.out.print(i + " ");
}





6-6-2: How many times does the following method print a *?

for (int i = 3; i <= 9; i++)
{
   System.out.print("*");
}





6-6-3: What does the following code print?

int x = -5;
while (x < 0)
{
   x++;
   System.out.print(x + " ");
}