有以下程序
#include "stdio.h"
main()
{ int a,b,c=246;
a=c/100%9;
b=(-1)&&(-1);
printf("%d,%d\n",a,b);
}
输出结果是()。
A. 2,1
B. 3,2
C. 4,3
D. 2,-1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346515.html
点击查看答案
以下有关switch语句的正确说法是()。
A. break语句是语句中必须的一部分
B. 在switch 语句中可以根据需要使用或不使用break语句
C. break语句在switch 语句中不可以使用
D. 在switch 语句中的每一个case都要用break语句
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651c.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
点击查看答案
有以下程序段
int i,n;
for(i=0;i<8;i++)
{ n=rand()%5;
switch (n)
{ case 1:
case 3:printf("%d\n",n); break;
case 2:
case 4:printf("%d\n",n); continue;
case 0:exit(0);
}
printf("%d\n",n);
}
以下关于程序段执行情况的叙述,正确的是( )。
A. for循环语句固定执行8次
B. 当产生的随机数n为4时结束循环操作
C. 当产生的随机数n为1和2时不做任何操作
D. 当产生的随机数n为0时结束程序运行
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651c.html
点击查看答案
C语言中文件的存取方式是()。
A. 顺序存取
B. 随机存取
C. 顺序存取,随机存取均可
D. 顺序存取,随机存取均不可
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346517.html
点击查看答案
有以下程序
#include "stdio.h"
void main( )
{ int n[3][3], i, j;
for(i=0;i<3;i++ )
for(j=0;j<3;j++ )
n[i][j]=i+j;
for(i=0;i<2;i++ )
for(j=0;j<2;j++ )
n[i+1][j+1]+=n[i][j];
printf("%d\n", n[i][j]);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346505.html
点击查看答案
以下叙述中错误的是 ( )。
A. gets函数用于从终端读入字符串
B. getchar函数用于从磁盘文件读入字符
C. fputs函数用于把字符串输出到文件
D. fwrite函数用于以二进制形式输出数据到文件
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034650b.html
点击查看答案
若有如下定义变量:
int k=7,x=12; 则能使值为3的表达式是
()。
A. x%=(k%=5)
B. x%=(k-k%5)
C. x%=k-k%5
D. (x%=k)-(k%=5)
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346508.html
点击查看答案
有以下程序
main()
{int i;
for(i=1;i<=40;i++)
{if(i++%5==0)
if (++i%8==0) printf("%d",i) ;}
printf("\n") ;} 执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651b.html
点击查看答案
下列程序执行后的输出结果是( )。 #include "stdio.h"
void main()
{
int i;
for(i=1;i+1;i++)
{
if(i>4)
{ printf("%d\n",i);
break;
}
printf("%d\n",i++);
}
}
A. 1 3 5
B. 1
3
5
C. 1
2
3
D. 1
2
4
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346503.html
点击查看答案