有以下程序
#include
void fun(char *c)
{ while(*c)
{ if(*c>='a'&&*c<='z') *c=*c-('a'-'A');
c++;
}
}
void main()
{ char s[81];
gets(s); fun(s); puts(s):
}
当执行程序时从键盘上输入Hello Beijing<回车>,则程序的输出结果是( )。
A. hello beijing
B. Hello Beijing
C. HELLO BEIJING
D. hELLO Beijing
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650d.html
点击查看答案
有以下程序
#include
main()
{ int x=011;
printf("%d\n",++x);
}
程序运行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651a.html
点击查看答案
有以下程序
#include
main()
{ int x=1,y=0;
if(!x) y++;
else if(x==0)
if (x) y+=2;
else y+=3;
printf("%d\n",y);
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651f.html
点击查看答案
有以下程序
main()
{ int i,s=1;
for (i=1;i<50;i++)
if(!(i%5)&&!(i%3)) s+=i;
printf("%d\n",s);}
程序的输出结果是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651d.html
点击查看答案
有以下程序
#include
#define M 5
#define N M+M
void main()
{ int k;
k=N*N*5; printf("%d\n",k);
}
执行后的输出结果是( )。
A. 50
B. 55
C. 500
D. 550
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346501.html
点击查看答案
若有数组定义: char array [ ]="China"; 则数组 array所占的空间为( )。
A. 4个字节
B. 5个字节
C. 6个字节
D. 7个字节
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651e.html
点击查看答案
下列变量定义中合法的是()。
A. short _a=1-.le-1;
B. double b=1+5e2.5;
C. long do=0xfdaL;
D. float 2_and=1-e-3;
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346511.html
点击查看答案
C语言中,数组名代表()。
A. 数组全部元素的值
B. 数组首地址
C. 数组第一个元素的值
D. 数组元素的个数
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346503.html
点击查看答案
以下程序的输出结果是()。
main()
{ int a=4,b=5,c=0,d;
d=!a&&!b||!c;
printf("%d\n",d);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650b.html
点击查看答案
有语句char str1[10],str2[10]={"china"};则能将字符串china赋给数组str1的正确语句是( )。
A. str1={"china"};
B. strcpy(str1,str2);
C. str1=str2;
D. strcpy(str2,str1);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034651d.html
点击查看答案