更多"有以下程序 #include<stdio.h> main( ) "的相关试题:
[单项选择]有以下程序
#include
main( )
{ char str[][20]={"Hello","Beijing"},*p=str;
printf("%d/n",strlen(p+20));
}
程序运行后的输出结果是()
A. 0
B. 5
C. 7
D. 20
[单项选择]有以下程序
#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<stdio.h>
main( )
unsigned char a=8, c;
c=a>>3;
printf("%d/n", c);
程序运行后的输出结果是______。
A. 32
B. 16
C. 1
D. 0
[单项选择]有以下程序:
#include <string.h>
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));
程序运行后的输出结果是( )。
[单项选择]有以下程序
#include<iostream.h>
void main( )
int a=5,b=0,c=0;
if(a=b+c)cout<<"***"<<endl;
else cout<<"$$$"<<<endl;
下列选项叙述正确的是( )。
A. 有语法错不能通过编译
B. 可以通过编译但不能通过连接
C. 输出***
D. 输出$$$
[单项选择]以下程序运行后的输出结果是
#include <stdio.h>
main( )
char a=4:
printf("%d/n",a=a<<1);
A. 40
B. 16
C. 8
D. 4
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
main( )
int x=1,y=2,z=3;
it(x>y)
if(y<z) printf("%d",++z);
else printf("%d",++y);
printf("%d/n",x++);
A. 331
B. 41
C. 2
D. 1
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
main( )
int i,j;
for(i=3;i>=1;i--)
for(j=1;j<=2;j++)printf("%d",i+j);
printf("/n");
A. 2 3 4
B. 4 3 2
C. 2 3
D. 4 5
[单项选择]以下程序的输出结果是( )。
#include <stdio.h>
main( )
int a=21,b=11;
printf("%d/n",--a+b,--b+
A. ;
[单项选择]有以下程序
#include<stdio.h>
main( )
char s[]="012xy/08s34f4w2";
int i, n=0;
for(i=0; s[i]!=0; i++)
if(s[i]>='0'&&s[i]<='9') n++;
printf("%d/n", n);
程序运行后的输出结果是______。
A. 0
B. 3
C. 7
D. 8
[单项选择]有以下程序:
#include <stdio.h>
main( )
int a [10]=1,2,3,4,5,6,7,8,9,10,*p=&a[3], *q=p+2;
prinff("%d/n";*p+*q);
程序运行后的输出结果是( )。
A. 16
B. 10
C. 8
D. 6
[单项选择]有以下程序:
#include <stdio.h>
main( )
int i,s=0;
for(i=1;i<10;i+ =2) s+ =i+1;
printf("%d/n",s);
程序执行后的输出结果是( )。
A. 正整数1~9的累加和
B. 正整数1~10的累加和
C. 正整数1~9中奇数之和
D. 正整数1~10中偶数之和
[单项选择]有以下程序:
#include <stdio.h>
main( )
int x=102,y=012;
printf("%2d,%2d/n",x,y);
执行后的输出结果是( )。
A. 10,01
B. 02,12
C. 102,10
D. 02,10
[单项选择]有以下程序:
#include <stdio.h>
main( )
char a[]="abcdefg",b[10]="abcdefg";
printf("%d%d/n",sizeof(
A. ,sizeof(
B. );
[单项选择]有以下程序:
#include <stdio.h>
main( )
int a[] = 2,4,6,8,10 ,y =0,x, * p;
p =&a[1];
for(x=1;x<3;x++)y+ =p[x];
printf( "% d /n" , y);
程序运行后的输出结果是( )。
A. 10
B. 11
C. 14
D. 15
[单项选择]有以下程序
#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 <sldio.h>
main( )
int x=0,y=5,z=3;
while(z-->0&& ++x<5) y=y-1;
printf("%d,%d,%d/n",x,y,z);
程序执行后的输出结果是( )。
A. 3,2,0
B. 3,2,-1
C. 4,3,-1
D. 5,-2,-5
[单项选择]有以下程序:
#include<stdio.h>
main( )
char c1='1', c2='2';
c1=getchar( ); c2=getchar( ); putchar(c1); putchar(c2);
当程序运行时输入a<回车>后,下列叙述中正确的是( )。
A. 变量c1被赋予字符a,c2被赋予回车符
B. 程序将等待用户输入第2个字符
C. 变量c1被赋予字符a,c2中仍是原有字符2
D. 变量c1被赋予字符a,c2中将无确定值