APP下载
首页
>
文学知识
>
C语言程序设计题库
搜索
C语言程序设计题库
题目内容
(
单选题
)
13.程序段“int n=3; do{printf( ); }while( );”的执行结果是( )。

A、 3 2 1

B、 2

C、 3

D、 死循环

答案:DN

C语言程序设计题库
21.已有定义“int b=7;float a=2.5,c=4.7;”,则表达式“a+( )( 的值是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-30d0-c003-bc7499099f02.html
点击查看题目
1.已有定义“int a=3, b=4, c=5;”,则下列表达式中值为0的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-e650-c003-bc7499099f00.html
点击查看题目
1.2,12.1
第4章 分支结构程序设计
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4a10-c003-bc7499099f02.html
点击查看题目
27.已有定义“char ch1[10]={0},ch2[10]="books";”,则能将字符串"books"赋给数组ch1保存的表达式是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-0160-c003-bc7499099f00.html
点击查看题目
5.4 3 26.3 13 557.1 2 18.Str[]=abdef
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-8800-c003-bc7499099f00.html
点击查看题目
11.B12.D13.C14.B15.C16.A17.D18.A
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4a10-c003-bc7499099f01.html
点击查看题目
1.A2.A3.D4.C5.B6.B7.A8.C9.C10.D
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4a10-c003-bc7499099f00.html
点击查看题目
5.下面程序用[2,10]之间的所有正整数验证定理:对于任意一个正整数都可以找到至少一串连续奇数,它们的和等于该正整数的立方。例如,33=27=7+9+11,43=64=1+3+5+7+9+11+13+15。
#include
int main()
{ long n, i, k, j, p, sum;
for(n=2;n<=10;n++)
{k=n*n*n;
for(i=1;i<k/2;i+=2)
{for(j=i, sum=0;( (9) ) ;j+=2)
sum+=j;
if( )
{printf( );
for(p=i;p<( (10) );p+=2) printf( );
printf("%1d", p);
break; }
}
if(i>=k/2) printf( );
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-1318-c003-bc7499099f00.html
点击查看题目
12.首地址
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-2010-c003-bc7499099f01.html
点击查看题目
43.在下面程序中,需要在main()函数之后定义一个函数,下面选项中( )可以用做该函数的名字。
#include
#define p 3.14
int m;
int main()
{ int n = 1;
函数名( );

}
int函数名( )
{return c*c;}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-4b50-c003-bc7499099f00.html
点击查看题目
首页
>
文学知识
>
C语言程序设计题库
题目内容
(
单选题
)
手机预览
C语言程序设计题库

13.程序段“int n=3; do{printf( ); }while( );”的执行结果是( )。

A、 3 2 1

B、 2

C、 3

D、 死循环

答案:DN

分享
C语言程序设计题库
相关题目
21.已有定义“int b=7;float a=2.5,c=4.7;”,则表达式“a+( )( 的值是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-30d0-c003-bc7499099f02.html
点击查看答案
1.已有定义“int a=3, b=4, c=5;”,则下列表达式中值为0的是( )。

A.  a&&b

B.  a<=b

C.  a||b&&c

D.  !(!c||1)

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-e650-c003-bc7499099f00.html
点击查看答案
1.2,12.1
第4章 分支结构程序设计
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4a10-c003-bc7499099f02.html
点击查看答案
27.已有定义“char ch1[10]={0},ch2[10]="books";”,则能将字符串"books"赋给数组ch1保存的表达式是( )。

A.  ch1="books";

B.  strcpy(ch2, ch1);

C.  ch1=ch2;

D.  strcat(ch1, ch2);

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-0160-c003-bc7499099f00.html
点击查看答案
5.4 3 26.3 13 557.1 2 18.Str[]=abdef
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-8800-c003-bc7499099f00.html
点击查看答案
11.B12.D13.C14.B15.C16.A17.D18.A
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4a10-c003-bc7499099f01.html
点击查看答案
1.A2.A3.D4.C5.B6.B7.A8.C9.C10.D
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-4a10-c003-bc7499099f00.html
点击查看答案
5.下面程序用[2,10]之间的所有正整数验证定理:对于任意一个正整数都可以找到至少一串连续奇数,它们的和等于该正整数的立方。例如,33=27=7+9+11,43=64=1+3+5+7+9+11+13+15。
#include
int main()
{ long n, i, k, j, p, sum;
for(n=2;n<=10;n++)
{k=n*n*n;
for(i=1;i<k/2;i+=2)
{for(j=i, sum=0;( (9) ) ;j+=2)
sum+=j;
if( )
{printf( );
for(p=i;p<( (10) );p+=2) printf( );
printf("%1d", p);
break; }
}
if(i>=k/2) printf( );
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-1318-c003-bc7499099f00.html
点击查看答案
12.首地址
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-2010-c003-bc7499099f01.html
点击查看答案
43.在下面程序中,需要在main()函数之后定义一个函数,下面选项中( )可以用做该函数的名字。
#include
#define p 3.14
int m;
int main()
{ int n = 1;
函数名( );

}
int函数名( )
{return c*c;}

A.  main

B.  m

C.  print

D.  p

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-4b50-c003-bc7499099f00.html
点击查看答案
试题通小程序
试题通app下载