有以下程序
#include "stdio.h"
void main()
{ int a=111;
a=a^00;
printf("%d,%o\n",a,a);
}
执行后的输出结果是( )。
A. 111157
B. 0,0
C. 20,24
D. 7,7
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650c.html
点击查看答案
有以下程序
#include
int f(int m)
{static int n=0;
n+=m;
return n;
}
main()
{int n=0;
printf(“%d,”,f(++n));
printf(“%d\n”,f(n++));
}
程序运行后的输出结果是()。
A. 1,2
B. 1,1
C. 2,3
D. 3,3
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346512.html
点击查看答案
#include
int streql(char *str1,char *str2)
{ while((*str1==*str2)&&(*str1))
{
str1++;
str2++;
}
return((*str1==NULL)&&(*str2==NULL));
}
void main()
{
printf("%d",streql("abc","Abc"));
}
程序的运行结果是 ( ) 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346509.html
点击查看答案
函数调用语句:fseek(fp,-10L,2);的含义是( )。
A. 将文件位置指针从文件末尾处向文件头的方向移动10个字节
B. 将文件位置指针从当前位置向文件头的方向移动10个字节
C. 将文件位置指针从当前位置向文件末尾方向移动10个字节
D. 将文件位置指针移到距离文件头10个字节处
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346518.html
点击查看答案
x,y,z被定义为int型变量,若从键盘给x,y,z输入数据,正确的输入语句是 ()。
A. INPUT x,y,z;
B. scanf("%d%d%d",&x,&y,&z);
C. scanf("%d%d%d",x,y,z);
D. read("%d%d%d",&x,&y,&z);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346521.html
点击查看答案
以下叙述不正确的是()。
A. 一个C源程序可由一个或多个函数组成
B. 一个C源程序必须包含一个main函数
C. C程序的基本组成单位是函数
D. 在C程序中,注释说明只能位于一条语句的后面
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651d.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int a=1;
char c='a';
float f=2.0;
printf("%d\n",(!(a==0),f!=0&&c=='A'));
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650d.html
点击查看答案
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char s1[50]={"some string *"},s2[]={"test"};
printf("%s\n", strcat(s1,s2));
}
执行后的输出结果是( )。
A. some string
B. test
C. some stritest
D. some string *test
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346511.html
点击查看答案
有以下程序
void swap(char *x,char *y)
{char t;
t=*x; *x=*y; *y=t;
}
main()
{char *s1="abc",*s2="123";
swap(s1,s2);printf("%s,%s\n",s1,s2);
}
程序执行后的输出结果是()。
A. 123,abc
B. abc,123
C. 1bc,a23
D. 321,cba
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346516.html
点击查看答案
下列程序段执行后,s的值是( )
static char ch[]="600";
int a,s=0;
for(a=0;ch[a]>='0'&&ch[a]<='9';a++)
s=10*s+ch[a]-'0';
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650b.html
点击查看答案