AI智能整理导入 AI智能整理导入
×
首页 题库中心 c语言程序设计题库 题目详情
CA85E835B92000012B50FB49F93816B5
c语言程序设计题库
1,073
单选题

以下程序的运行结果是( )
#include
void main(void)
{
int m = 5;
if (m++ > 5)
{
printf("%d\n", m) ;
}
else
{
printf("%d\n", m--) ;
}
}

A
6
B
4
C
5
D
7

答案解析

正确答案:A

解析:

选择结构程序设计
c语言程序设计题库

扫码进入小程序
随时随地练习

相关题目

单选题

下面程序的输出结果是 ()
char s[] = "ABCD";
void main(void)
{
char *p = NULL;
for ( p = s; p < s + 4; p++ )
{
printf("%s\n", p) ;
}
}

单选题

下面函数的功能是( )
int fun( char * x )
{
char *y = x;
while ( *y++ ) ;
return ( y - x - 1 );
}

单选题

下面程序的输出结果是( )
# include
# include
void main( void )
{
char *pstr1 = "abc";
char *pstr2 = "ABC";
char str[50] = "xyz";
strcpy( str + 2 , strcat( pstr1, pstr2 ) ) ;
printf( "%s\n", str ) ;
}

单选题

表达式 3. 6 - 5 / 2 + 1. 2 + 5 % 2 的值是( )

单选题

设有如下函数定义:
int fun( char *s )
{
char *p = s;
while ( *p != ' \0' )
{
p++;
}
return ( p - s ) ;
}
如果在主程序中用下面的语句调用上述函数, 则输出结果为( )
printf( "%d\n", fun( "goodbye!") ) ;

单选题

以下关于 while() 循环说法正确的是( )

单选题

要求函数的功能是交换 x 和 y 中的值, 且通过正确调用返回交换结果。能正确执行此功能的函数是( )

单选题

以下说法错误的是( )

单选题

以下程序运行后, 输出结果是
#include
void main(void)
{
char *s="defde";
s+=2;
printf("%d\n", s) ;
}

单选题

下面的程序的输出结果是( )
# include
fun( int *s, int n1, int n2 )
{
int i = 0;
int j = 0;
int t = 0;
i = n1;
j = n2;
while( i < j )
{
t = *( s + i ) ;
*( s + i ) = *( s + j ) ;
*( s + j ) = t;
i++;
j++;
}
}
main()
{
int a[ 10 ] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 } ;
int i = 0;
int *p = a;
fun( p, 0, 3 ) ;
fun( p, 4, 9 ) ;
fun( p, 0, 9) ;
for( i = 0; i < 10; i++ )
{
printf("%d", *(a + i ) ) ;
}
}

关闭
专为自学备考人员打造
试题通
自助导入本地题库
试题通
多种刷题考试模式
试题通
本地离线答题搜题
试题通
扫码考试方便快捷
试题通
海量试题每日更新
试题通
欢迎登录试题通
可以使用以下方式扫码登陆
试题通
使用APP登录
试题通
使用微信登录
xiaochengxu
联系电话:
400-660-3606
xiaochengxu