网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列程序的执行结果是( )。 Function P(N As Integer) For i=1 To N Sum=Sum+i Next i P=Sum End Function Private Sub Command1_Click() S=P(1)+P(2)+P(3)+P(4) Print S; End Sub

A.15

B.16

C.2O

D.25


参考答案

更多 “ 下列程序的执行结果是( )。 Function P(N As Integer) For i=1 To N Sum=Sum+i Next i P=Sum End Function Private Sub Command1_Click() S=P(1)+P(2)+P(3)+P(4) Print S; End SubA.15B.16C.2OD.25 ” 相关考题
考题 单击一次命令按钮后,下列程序的执行结果是( )。 Private Sub Commandl_Click() s=P(1)+P(2)+P(3)+P(4) Print s End Sub Public FunctionP(N As Integer) Static Sum Fori=1To N Sum=Sum+i Nexti P=Sum End FunctionA.15B.25C.35D.45

考题 以下程序的输出结果是 ______。 Dim n(2,2), i, j As Integer For i = 0 To 2 For j = 0 To 2 n(i,j) = i + j Next j Next i For i = 0 To 1 For j = 0 To 1 n(i+ 1 ,j + 1) = n(i + 1,j + 1) + n(i, j) Next j Next i Print n(i, j)A.14B.0C.6D.值不确定

考题 单击一次命令按钮后,下列程序的执行结果是Private Sub Command1_Click()s=P(1) + P(2) + P(3) + P(4)Print sEnd SubPublic Function P(N As Integer)Static SumFor i=1 To NSum=Sum + iNext iP=SumEnd Function( )。A.15B.25C.35D.45

考题 (11)在窗体上画一个名为 Command1 的命令按钮,然后编写如下程序:Private Sub Command1_Click( )Dim i As IntegerSum=0n=InputBox("Enter a number")n=Val(n)For i=1 To nSum= 【12】Next iPrint SumEnd SubFunction fun(t As Integer)As Longp=1For i=1 To tp=p*iNext i【13】End Function以上程序的功能是,计算 1!+2!+3!+?+n!,其中 n 从键盘输入,请填空。

考题 在窗体中有一个命令按钮command1,编写事件代码如下: Private Sub Command1_Click() Dim s As Integer s=P(1)+P(2)+P(3)+P(4) Debug.Print s End Sub Public Function P(N As Integer) Dim Sum As Integer Sum=0 For i=1 To N Sum=Sum+1 Next i P=Sum End Function 打开窗体运行后,单击命令按钮,输出的结果是( )。A.15B.20C.25D.35

考题 有如下程序: Private Sub Form_Click() Dim i As Integer,Sum As Integer Sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then Sum=Sum+i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为A.12B.30C.24D.18

考题 下列程序的执行结果是 Function P(N As Integer) For i=1 To N Sum=Sum+i Next i P=Sum End Function Private Sub Commandl_Click() S=P(1)+P(2)+P(3)+P(4) Print S End SubA.15 B.16 C.20 D.25

考题 ●下列程序运行后输出的数据是(51)。int sum(int n){int p=1;int s=0;int i=0;for(i=1;i﹤=n;i++) s+=(p*=i);retum s;}main(){printf((“sum(5)=%d\n”,sum(5));}(51) A.sum(5)=151B.sum(5)=152C.sum(5)=153D.sum(5)=155

考题 阅读下列程序: Function func(n As Integer)As Integer Sum = 0 For i = 1 To n Sum = Sum + (i + 1)* i Next i func = Sum End Function.Private Sub Command1_Click () Dim a As Integer a= 5 s = func (A)Print s End Sub 程序运行后,单击命令按钮,输出的结果为A.80B.60C.70D.15

考题 在窗体中有一个命令按钮Commandl,编写事件代码如下:Private Sub Commandl Click( ) Dim S As Integer s=p(1)q+p(2)q+p(3)+p(4) debu9.Print S End Sub Public Function P(N As Integer) Dim Sum As IntegerSum==0 For i=1 To N Sum=Sum+1 Next i P=Sum End Function 打开窗体运行后,单击命令按钮,输出的结果是( )。A.15B.20C.25D.35

考题 下列程序段的输出结果是【】。 include void main() {inti=10,sum=0;do{sum=+sum+i;i=i 下列程序段的输出结果是【 】。include<iostream.h>void main(){int i=10,sum=0;do{sum=+sum+i;i=i-2;}while(i>=2);cout<<sum<<end1;}

考题 单击一次命令按钮后,下列程序的执行结果是 Private Sub Command1_Click() s=P(1) +P(2) +P(3) +P(4) Print s End Sub Public Function P(N As Integer) Static Sum For i=1 To N Sum=Sum+i Next i P=Sum End FunctionA.15B.25C.35D.45

考题 在窗体上画一个名称为 Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a(4)As Integer, x As Integer, sum As Integer n = 4: sum = 0 a (1) = 1 For k = 0 To n - 1 For i = 1 To k + 1 x = k + 2 - i a(x)= a(x)+ a(x - 1) If x < n - k Then Exit For sum = sum + a(x) Next i Next k Print sum End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.5B.6C.8D.11

考题 下面程序执行的结果是【 】。 include using namespace std; void main(){ int sum=0; i 下面程序执行的结果是【 】。include <iostream>using namespace std;void main(){int sum=0;int array[6]={1,2,3,4,5,6};int *p;p=array[0];for(int i=0;i<6;i++){sum=sum+*p;p++;}cout<<sum;}

考题 单击命令按钮之后,下列程序代码的执行结果为______。 Private Function P(N As Integer) Static sum For I=I To N Sum = sum +1 Next I P =sum End Function Private Sub Command1_Click() S=P(1)+P(2)+P(3)+P(4) Print S: End SubA.20B.30C.115D.135

考题 在窗体上画一个名为Commandl的命令按钮,然后编写如下程序:Private Sub Conunandl_Click()Dim i As IntegerSum=0n=InputBox(”晰a number”)n=Val(n)For i=1 T0 nSum=【 】Nextiprint SumEnd SubFunction fun(t As Integer)As LongP=1For i=1 To tP=P*iNext i【 】End Function以上程序的功能是,计算1 1+2 1+3 1+…+n!,其中n从键盘输入,请填空。

考题 单击一次命令结束后,下列程序的执行结果是 Private Sub Commandl_Click( ) s=Sat(1)+Sat(2)+Sat(3)+Sat(4) Print s End Sub Public Function Sat(N As Integer) Static Sum For i=1 To N Sum=Sum+i Next i Sat=Sum End FunctionA.15B.25C.35D.45

考题 单击一次命令按钮之后,下列程序代码的执行结果为 private Sub Command1_Click() S=P(1) +P(1)+P(2)+P(3)+P(4) Print S: End Sub Public Function P(N As Integer) Static Sum For I=1 To n Sum=Sum+I Next 1 P=Sum End FunctionA.20B.35C.115D.135

考题 在窗体中有一个命令按钮Commandl,编写事件代码如下:Private Sub Command1_CliCk()Dim s As Integers=P(1)+P(2)+e(3)+P(4)debug.Print SEnd SUbPublic Function P(N AS Integer)Dim Sum As IntegerSum=0For i=1 To NSum=Sum+iNext iP=SumEnd Function打开窗体运行后,单击命令按钮,输出结果是A.15B.20C.25D.35

考题 有如下程序:: Private Sub Form. Click() Dim i As Integer,sum As Integer sum=0 For i=2 To 10 If i Mod 2 <>0 And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。A. 12B.30C.24D.18

考题 有如下程序: Private Sub Form_Click() Dim i As Integer, Sum As Integer sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。A.12B.30C.24D.18

考题 单击命令按钮后,下列程序代码的执行结果是______。Public Sub fun (a As Integer, b As Integer, c As Integer)Doa=b+ cn=n+1Loop While n > 3End SubPrivate Sub command1_ click()Dim m As Integer, n As Integer, i As IntegerFor i = 0 To 2: m = n + 1: Next iFor i = 1 To 2: Call fun (m, n, i): Next iFor i = 0 To 3Print m;Next iEnd Sub

考题 下列程序的执行结果是( )。Function P(N As Integer)For i=1 To NSum=Sum+iNext iP=SumEnd FunctionPrivate Sub Command1_Click()S=P(1)+P(2)+P(3)+P(4)Print S;End SubA.15B.16C.20D.25

考题 程序如下:Private Sub form_ Activate() Dim a As Integer for i=4 To 5 a=fun(i) Print a, Next iEnd SubPrivate Function fun(n)As Integer if n >0 then fun =n* fun(n-1) Else fun=1 End ifEnd Function 程序最后打印结果是______。A.4 5B.12 120C.24 120D.24 60

考题 阅读程序: Function fac(ByVal As Integer)As Integer Dim temp As Integer temp=1 For i%=1 To n temp=temp*i% Next i% fac=temp End Function Private Sub Form. Click( ) Dim nsum As Integer nsum=1 For i%=2 T0 4 nsum=nsum+fac(i%) Next i% Print nsum End Sub 程序运行后,单击窗体,输出结果是( )。A.35B.31C.33D.37

考题 有如下程序: Private Sub Form_CHck() Dim i As Integer,sum As Integer sum=0 For i=2 TO 10 If Mod 2 <>And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。A.12B.30C.24D.18

考题 下列程序执行后的输出结果是()。includemain(){int a[3][3],*p,i; p=a[0][0]; for 下列程序执行后的输出结果是( )。 #include <stdio.h> main() { int a[3][3],*p,i; p=a[0][0]; for(i=1;i<9;i++) p[i]=i+1; printf("%d\n",a[1][2]); }A.3B.6C.9D.随机数