更多"阅读以下程序: #include<iostream.h> voi6"的相关试题:
[单项选择]阅读以下程序
#include
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<iostream.h>
void main( )
{
char line[10];
cin>>line;
cout<<line<<endl;
}
如运行时输入This is example.<CR>,则程序的输出结果是
A. This
B. This is
C. This is a
D. This is an exampl
[单项选择]
有以下程序
#include <string.h>
main( )
{ char str[][20]={"Hello","Beijing"},*p=str;
printf("%d/n",strlen(p+20));
}
程序运行后的输出结果是 ()
A. 0
B. 5
C. 7
D. 20
[单项选择]阅读以下程序 #includc<iostream.h> vold main( ) { Char line[10]; cin>>line; cout<<line<<endl; } 如运行时输入This is example.<CR>,则程序的输出结果是
A. This
B. This is
C. This is a
D. This is an exampl
[单项选择]阅读以下程序 #include<iostream.h> void main( ) { charline[10]; in>>line; cout<<line<<endl; } 如运行时输入This is an example.<CR>,则程序的输出结果是( )。
A. This
B. This is
C. This is a
D. This is an exampl
[单项选择]阅读以下程序# include<fstream. h>void main( ){ifstream infile;ofstream outfile;{stream iofile;iofile. open("a. txt", ios:: in);iofile. close( );iofile. open('b. txt" ,ios: :out):....}下列描述错误的是
A. 对象infile只能用于文件输入操作
B. 对象outfile只能用于文件输出操作
C. 对象iofile在文件关闭后,不能再打开另一个文件
D. 对象iofile可以打开一个文件同时进行输入和输出
[单项选择]阅读以下程序 #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 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
[单项选择]以下程序的输出结果是_______。 main( ) { char st[20]="hello/0/t//"; printf(%d%d/n",strlen(st),sizeof(st)); }
A. 99
B. 520
C. 1320
D. 2020
[单项选择]以下程序的输出结果是______。 main( ) { char st[20]="hello/0/t//"; printf("%d%d/n",strlen(st),sizeof(st)); }
A. 99
B. 520
C. 1320
D. 2020
[单项选择]请阅读以下程序: main( ) { int a=5,b=0,c=0; if(a=b+c)printf(”"***/n"); else printf("$$$/n");} 以上程序
A. 有语法错不能通过编译
B. 可以通过编译但不能通过连接
C. 输出***
D. 输出$$$
[单项选择]下列程序的输出结果是( )。 #include "stdio.h" main( ) { struct st { int y,x,z;}; union {long i;int j; char k;} un; printf("%d,%d/n",sizeo(struct st),sizeof(un)); }
A. 6,2
B. 6,4
C. 8,4
D. 8,6
[单项选择]下列程序的运行结果是( )。 #include<stdio.h> main( ) { static char a[]="Languagef",b[]="programe"; char *p1,*p2;int k; p1=a;p2=b; for(k=0;k<=8;k++) if(*(p1+k)==*(p2+k))printf("%c",*(p1+k)); }
A. gae
B. ang
C. program
D. 有语法错
[单项选择]下列程序段的输出结果为( )。 #include<stdio.h> main( ) { static char a[]="language"; char*p; p=a; for(p=a;p<a+8;p+=2) putchar(*p); }
A. language
B. lnug
C. 有语法错误
D. lang
[单项选择]阅读以下C程序段: main( ) { int x; scant("%d",&x); if(x--<5=printf("%d",x); else printf("%d",x++); } 程序运行后,如果从键盘上输入5,则输出结果是:()
A. 3
B. 4
C. 5
D. 6
[单项选择]阅读以下C程序段: main( ) { int x; scant("%d",&x); if(x--<5=printf("%d",x); else printf("%d",x++); } 程序运行后,如果从键盘上输入5,则输出结果是:
A. 3
B. 4
C. 5
D. 6