下列程序段的运行结果是 。 Subsele() Dim n As Integer i=21:n=3 Do While i>n i=i-n Loop Print i End Sub
A: 2
B: 4
C: 5
D: 3
A: 2
B: 4
C: 5
D: 3
举一反三
- 下列程序段的运行结果是( )。 Sub sele() Dim n As Integer i=21:n=3 Do While i>n i=i—n Loop Print i End Sub A: 3 B: 4 C: 5 D: 3.2
- 运行下面的程序,第二行显示结果是___________。 Private Sub Form_Click() Dim A As Integer Dim i As Integer A = 5 For i = 1 To 9 Call sub1(i, A) Print i, A Next i End Sub Private Sub sub1(x As Integer, y As Integer) Static N As Integer Dim I As Integer For I = 3 To 1 Step -1 N = N + x x = x + 2 Next I y = y + N End Sub
- 声明一个变量为局部变量应该用( )。 A: Private Sub Command1 Click() n=5:x=1 Do X=X * I I=I + 1 Loop While I < n Print x End Sub B: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X*I I=I + 1 Loop While I <n Print x End Sub C: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I<=n Print X End Sub D: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I>n Print X End Sub
- 以下程序的输出结果是n=4 #include void main() { int i,n=0; for(i=2;i<5;i++) { do { if(i%3) continue; n++; } while(!i); n++; } printf("n=%d",n); }
- 下列程序的运行结果为( )。Private Sub Command1_Click() Dim a(5) As String Dim i As Integer For i = 0 To 5 a(i) = i + 1 Print a(i); Next iEnd Sub A: 123456 B: 6 C: 1 2 3 4 5 6 D: 0