If k is integer, how many times will the following "while" loop be executed?k = 50 while k >; 1: print(k) k = k // 2
A: 3
B: 4
C: 5
D: 6
A: 3
B: 4
C: 5
D: 6
C
举一反三
- If k is integer, how many times will the following "while" loop be executed?k = 50 while k > 1: print(k) k = k // 2 A: 3 B: 4 C: 5 D: 6
- How many times will the following while loop execute? [br][/br]k = 50 [br][/br]while k > 1: [br][/br]print(k) [br][/br]k = k // 2 A: 5 B: 3 C: 4 D: 6
- How many times will the loop body be executed? int k=0; while(k=1)k++;
- How many times is the loop body " k++;"<br/>executed in the following program segment? ( )<br/>int k=0; while(k=1)<br/>k++; A: Infinite B: 1 C: 0 D: compile error
- Private Sub Form_Click() k = 0: a = 0 Do While k < 70 k = k + 2 k = k * k + k a = a + k Loop Print a,k End Sub
内容
- 0
下面程序的运行结果 ________ 。 Dimension A(6) FOR K=1 TO 6 A(K)=30-3*K ENDFOR K=5 DO WHILE K>=1 A(K)=A(K)-A(K+1) K=K-1 ENDDO ?A(2),A(4),A(6)
- 1
若k为整型,则下述while循环执行的次数为()。Ak=10 while k>1: print(k) k = k/2 A: 4 B: 5 C: 10 D: 死循环
- 2
下列程序输出结果是______。 k=0 while k<=3: k=k+2 print(k) A: 0 B: 2 C: 3 D: 4
- 3
若k为整型,则下述while循环执行的次数为( )。Ak=10 while k>1: print(k) k = k/2 A: 4 B: 5 C: 10 D: 死循环
- 4
设执行以下程序段时依次输入1、3、5,执行结果为 。 Dim a(4) As Integer, b(4) As Integer For k = 0 To 2 a(k + 1) = Val(InputBox("请输入数据:")) b(3 - k) = a(k + 1) Next k Print b(k) A: 1 B: 3 C: 5 D: 0