设有如下程序: Private Sub Form. Click( ) Dim s As Long,f As Long Dim n As Integer,i As Integer f=1 n=4 For i=1 To n f=f*i s=s+f Next i Print s End Sub 程序运行后,单击窗体,输出结果是( )。
A.32
B.33
C.34
D.35
第1题:
都是VB.NET中的数据类型的选项是()
AShort、Integer、Long、Float、Double
BShort、Int、Long、Single、Double
CInteger、Long、Single、Double、Decimal
DBoolen、Byte、Bit、Decimal、Date
第2题:
设有定义int i=123;long j=456;,下列赋值不正确的是
A.j=i;
B.j=(long)i;
C.i=(int)j;
D.i=j;
第3题:
在标准模块中用:Dim或Private关键字定义的变量是______变量,它们只能在程序的模块中使用。
第4题:
下面程序执行后的输出结果是(小数点后只写一位)______。 main ( ) { double d; float f; long 1; int i; i=f=1=d=20/3; printf("%d %ld %f %f \n", i,l,f,d); }
A.6 6 6.0 6.0
B.6 6 6.7 6.7
C.6 6 6.0 6.7
D.6 6 6.7 6.0
第5题:
以下选项中,正确运用指针变量的程序段是( )。
A.int*i=NULL;
B.float*f=NULL; scanf("%d",i); *f=10.5;
C.char t='m',*C=&t;
D.long*L; *C=&t; L='0';
第6题:
若程序中已包含头文件stdio.h,以下选项中,正确运用指针变量的程序段是
A.int *i=NULL;
B.float *f=NULL;scanf("%d",i); *f=10.5;
C.char t='m', *c=&t;
D.long *L;
第7题:
设有如下程序: fun(float*p1,int n,float*p2,int m,float*s) {int i; *s=0.0; for(i=0;i<n;i++)*s+=*p1++; for(i=0;i<m;i++)*s+=*p2++; } main() { float a[]={1.1,2.2},b[]={1.0,2.0,3.0),*s=a; fun(a,2,b,3,s); printf("%f\n",*s); } 上面程序的输出结果是______。
A.8.2
B.9.3
C.3.3
D.1.1
第8题:
设有如下程序:
Private Sub Form_Click()
Dim n As Integer, s As Integer
n = 8
s = 0
Do
s = s + n
n = n - 1
Loop While n > 0
Print s
End Sub
以上程序的功能是______。程序运行后,单击窗体,输出结果为______。
求1-8的和 36
第9题:
A.Byte,Integer,Long,Decimal
B.Byte,Integer,Double,Boolean
C.Boolean,Byte,Integer,Double
D.Byte,Decimal,Integer,Long
答案:A
解析:Byte占用一个字节,integer占用两个字节,long占用四个字节,Decimal占用比4个字节要大。