Answer is A and E.
To test:
public static void main(String[] args) {
int x;
/* insert code here */
/* Option A - Ok */
/*
x = 3;
do {
System.out.print("*");
x--;
} while (x >= 0);
*/
/* Option B - It does not enter the loop. */
/*
x = 0;
do {
System.out.print("*");
x++;
} while (x >= 3);
*/
/* Option C - It does not enter the loop. */
/*
x = 0;
do {
System.out.print("*");
++x;
} while (x > 3);
*/
/* Option D - I only printed two asterisks */
/*
x = 3;
do {
System.out.print("*");
x--;
} while (x != 1);
*/
/* Option E - Ok /
/*
x=0;
do {
System.out.print("*");
}while(x++ < 3);
*/
}
The correct answer is the letter E, because it starts to put * from zero, analyze these questions well, the answers are very confusing precisely to take the time wrong on purpose.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
MPignaProTech
2 months, 3 weeks agoBelloMio
7 months, 1 week ago7df49fb
9 months, 3 weeks agoakbiyik
2 years, 1 month agocarloswork
2 years, 2 months agoiSnover
2 years, 3 months ago