更多"阅读以下程序: #include <stdio.h> main( "的相关试题:
[单项选择]阅读以下程序
#include<stdio.h>
main( )
int case; float printF;
printf("请输入2个数:");
scanf("%d %f", &case, &printF);
printf("%d %f/n", case, printF);
该程序编译时产生错误,其出错原因是()
A. 定义语句出错,case是关键字,不能用作用户自定义标识符
B. 定义语句出错,printF不能用作用户自定义标识符
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出case的值
[单项选择]阅读以下程序
#include<stdio.h>
main( )
Int Case;float printF;
printf("请输入2个数:");
scanf("%d %f",&Case,&printF);
printf("%d%f/n",Case,printF);
以下说法正确的是( )。
A. 定义浯句出错,Case是关键字,不能用作用户自定义标识符,printF不能用作用户自定义标识符
B. 定义语句出错,Int无法被识别
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出Case的值
[单项选择]阅读以下程序
#include <stdio.h>
main( )
int case;float printF;
printf("请输入2个数:");
scanf("%d %f",&case,&printF):
printf("%d %f/n",case,printF);
该程序在编译时产生错误,其出错原因是
A. 定义语句出错,case是关键字,不能用作用户自定义标识符
B. 定义语句出错,PrintF不能用作用户自定义标识符
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出case的值
[单项选择]阅读以下程序:
#include<stdio.h>
main( )
int case; float printF;
printf("请输入2个数:");
scanf("%d%f", &case, &printF);
printf("%d%f/n", case, printF);
该程序在编译时产生错误,其出错原因是
A. 定义语句出错,case是关键字,不能用作用户自定义标识符
B. 定义语句出错,printF不能用作用户自定义标识符
C. 定义语句无错,scanf不能作为输入函数使用
D. 定义语句无错,printf不能输出case的值
[填空题]有以下程序
#include
main( )
{
int d, n = 1234;
while(n != 0)
{ d = n % 10; n = n / 10; printf("%d", d); }
}
程序运行后的输出结果是____[10]______ 。
[单项选择]请阅读以下程序:
#include<stdio.h>
main( )
int x=1, y=0, a=0, b=0;
switch(x)
case 1;
switch(y)
case 0:a++; break;
case 2:
a++, b++; break;
printf("a=%d, b=%d/n", a, b);
上面程序的输出结果是( )。
A. a=2, b=1
B. a=1, b=1
C. a=1, b=0
D. a=2, b=2
[单项选择]有以下程序 #include <string.h> main(int argc, char *argv[]) {int i=1,n=0; while(i<argc) {n=n+strlen(argv[i]);i++;} printf("%d/n",n); } 该程序生成的可执行文件名为:proc.exe。若运行时输入命令行: proc 123 45 67 则程序的输出结果是______。
A. 3
B. 5
C. 7
D. 11
[单项选择]
有以下程序
#include
int f(int t[],int n);
main
{ int a[4]={1,2,3,4},s;
s=f(a,4); printf("%d/n",s);
}
int f(int t[],int n)
{ if(n>0) return t[n-1]+f(t,n-1);
else return 0;
}
程序运行后的输出结果是()
A. 4
B. 10
C. 14
D. 6
[单项选择]请阅读以下程序:
#include <stdio.h>
main( )
int x=1,y=0,a=0,b=0;
switch(x)
case 1:
switch(y)
case 0:a++;break;
case 2:
a++,b++;break;
printf("a=%d,b=%d/n",a,b);
上面程序运行后的输出结果是
A. a=2,b=1
B. a=2,b=1
C. a=1,b=0
D. a=2,b=2
[填空题]有以下程序
#include
main( )
{ int c[3]={0}, k ,i;
while((k=getchar( )!=’/n’)
c[k-’A’]++;
for(i=0;i<3;i++) printf("%d",c[i]); printf("/n");
}
若程序运行时从键盘输入ABCACC<回车>,则输出结果为 【12】 。
[填空题]
有以下程序
#include
main( )
{ int m,n;
scanf("%d%d",&m,&n);
while(m!=n)
{ while(m>n) m=m-n;
while(m
}
printf(“%d/n”,m);
}
程序运行后,当输入14 63 <回车> 时,输出结果是 () 。
[单项选择]有以下程序
#include
main( )
int x=8;
for( ; x>0; x--)
if(x%3)
printf("%d,",x--); continue;
printf("%d,",--x);
程序的运行结果是______。
A) 7,4,2
B) 8,7,5,2
C) 9,7,6,4
D) 8,5,4,2
[单项选择]有以下程序:
#include
main( )
{ FILE *fp; int i,k,n; fp=fopen("data.dat","w+"); for(i=1;i<6;i++)
{fprintf(fp,"%d ",i);
if(i%3==0) fprintf(fp,"/n");
}
rewind(fp);
fscanf(fp,"%d%d",&k,&n); printf("%d %d/n",k,n);
fclose(fp);
}
程序运行后的输出结果是______。
A. 0 0
B. 123 45
C. 1 4
D. 1 2