Which of the following loops will print the odd numbers between 0 and 20?
A) for (int num = 1; num < 20; num++) {
System.out.print (num % 2 + " ") ;
}
B) for (int num = 0; num < 20; num+= 2) {
System.out.print (num + " ") ;
}
C) for (int num = 1; num < 20; num+= 2) {
System.out.print (num + " ") ;
}
D) for (int num = 0; num < 20; num+= 2) {
If (num % 2 == 1)
System.out.print (num + " ") ;
}
Correct Answer:
Verified
Q95: Which statement about storyboards is true?
A)A storyboard
Q103: How many times does the following loop
Q104: Which of the following conditions can be
Q105: What is the first and last value
Q106: How many times does the following loop
Q107: For which input values will the following
Q109: Which code snippet produces the sum of
Q111: Suppose you must design a program to
Q112: Which of the following activities can be
Q113: A loop inside another loop is called:
A)
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents