1) What is a for loop used for in Java? a) To display graphics on the screen.Physical parts  b) To store information in a variable. c) To repeat a set of instructions a specific number of times. d) To stop the program immediately. 2) Which of the following is a type of loop in Java? a) case loop b) while loop c) print loop d) syntax loop 3) How many times will this loop run ? for (int i = 0; i < 3; i++)  a) 3 b) 1 c) 2 d) 8 4) What does the i++ mean in a for loop? a) Subtract 1 from i b) B) Add 1 to i c) C) Multiply i by 2 d) D) Divide i by 2 5) Which loop will always run at least once, even if the condition is false? a) A) while loop b) B) for loop c) C) do-while loop d) D) if statement 6) What keyword is used to stop a loop immediately in Java? a) continue b) stop c) break d) exit 7) What happens if a condition in a while loop is always true? a) The program will stop immediately. b) B) The loop will run forever. c) C) The loop will run once. d) D) It will cause an error. 8) Which of the following can be used as a condition in a while loop? a) i > 0 b) i == 5 c) true d) All of the above

Skor Tablosu

Görsel stil

Seçenekler

Şablonu değiştir

Otomatik olarak kaydedilen geri yüklensin mi: ?