更多"有以下程序: # include <strintg.h> main"的相关试题:
[单项选择]以下程序运行后的输出结果是
#include
#include
main( )
char str[][20]='One * World", "One * Dream!", *p=str[1];
printf("%d,", strlen(p)); printf("%s/n", p);
A. 9,One * World
B. 9,One * Dream
C. 10,One * Dream!
D. 10,One * World
[单项选择]有以下程序:
#include
#include
typedef struct char name[9];char sex;float score[2]; STU;
void f(STU
A. Qian,m,85,90
B. Zhao,f,95,92
C. Zhao,m,85,90
[单项选择]有以下程序
#include
main( )
{char c1,c2,c3,c4,c5,c6; scanf("%c%c%c%c",&c1,&c2,&c3,&c4); c5=getchar( ); c6=getchar( ); putchar(c1); putchar(c2); printf("%c%c/n",c5,c6);
}
程序运行后,若从键盘输入(从第1列开始)
123<回车>
45678<回车>
则输出结果是______。
A. 1267
B. 1256
C. 1278
D. 1245
[单项选择]有以下程序:
#include
main( )
{char p[20]=(‘a’,‘b’,‘C’,‘d’)q[]=“abc”,r[]=“abcde”;
strcat(p,r);strcpy(p+strlen(q),q);
printf(“%d/n”,strlen(p));
}
程序运行后的输出结果是( )。
A. 9
B. 6
C. 11
D. 7
[单项选择]以下程序的输出结果是
#include
void main( )
char c='Z';
cout < < c-25;
A. 97
B. Z
C. z-25
D. 2
[单项选择]有以下程序
#include
main( )
char p[20]='a','b','c','d',q[]="abc", r[]="abcde"
strcat(p,r); strcpy(p+strlen(q),q);
printf("%d /n",sizeof(p));程序运行后的输出结果是________。
A. 9
B. 6
C. 11
D. 7
[单项选择]阅读以下程序
#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 example.
[单项选择]有以下程序
#include 〈string.h〉
main ( )
char p[]='a','b ,'c', q[10]='a','b','c';
printf("%d %d/n",strlen(p),strlen(q));
以下叙述中正确的是
A. 在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3
B. 由于p数组中没有字符申结束符,长度不能确定;但q数组中字符串长度为3
C. 由于q数组中没有字符串结束符,长度不能确定:但p数组中字符串长度为3
D. 由于p和q数组中都没有字符串结束符,故长度都不能确定
[单项选择]有以下程序:
#include <string.h>
main( )
char str[][20]="Hello","beijing",*p=str;
ptintf("%/n",strlen(p+20));
程序运行后的输出结果是( )。
A. 0
B. 5
C. 7
D. 20
[单项选择]有以下程序:
# 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
[填空题]有以下程序
#include <stdio.h>
main( )
{ char ch1,ch2; int n1,n2;
ch1=getchar( );
ch2=getchar( );
n1=ch1-‘0’; n2=n1*10+(ch2-‘0’);
printf(“%d/n”,n2);}
程序运行时输入:12<回车>,执行后输出结果是【 】。
[单项选择]有以下程序:
#include <stdio.h>
main( )
union
charch[2];
int d;
s;
s.d=0x4321;
printf("%x,%x/n",s.ch[0],s.ch[1]);
在16位编译系统上,程序执行后的输出结果是( )。
A. 21,43
B. 43,21
C. 43,00
D. 21,00
[单项选择]有以下程序:
#include <stdio.h>
main( )
char k; int i;
for(i=1; i<3; i++)
scanf("%c",&k);
switch(k)
case '0': printf("another/n");
case '1': printf("number/n");
程序运行时,从键盘输入:01<回车>,程序执行后的输出结果是( )。
A. another
B. another
C. another
D. number
[填空题]有以下程序:
#include<stclio.h>
main( )
char c;
while((c=getchar( ))!=’’)putchar(--c);
程序运行时,如果从键盘输入:YN<回车>,则输出结果为______。