以下程序的输出结果是()。
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return s;}
main()
{ printf("%ld\n", fun(3)); }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650b.html
点击查看答案
设有int x,y; 以下语句判断x和y是否相等,正确的说法是该语句()。
if (x=y) printf(" x is equal to y.");
A. 语法错
B. 不能判断x和y是否相等
C. 编译出错
D. 能判断x和y是否相等
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651b.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int a=1, b=3, c=5;
int *p1=&a, *p2=&b, *p=&c;
*p =*p1*(*p2);
printf("%d\n",c);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650f.html
点击查看答案
有以下程序
#include
main()
{ char b,c; int i;
b='a'; c='A';
for(i=0;i<6;i++)
{ if(i%2) putchar(i+b);
else putchar(i+c);
} printf("\n");
}
程序运行后的输出结果是( )。
A. ABCDEF
B. AbCdEf
C. aBcDeF
D. abcdef
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651e.html
点击查看答案
下列程序的输出结果是 ( )。
#include "stdio.h"
main()
{ int i,a=0,b=0;
for(i=1;i<10;i++)
{ if(i%2==0)
{a++;
continue;}
b++;}
printf("a=%d,b=%d",a,b); }
A. a=4,b=4
B. a=4,b=5
C. a=5,b=4
D. a=5,b=5
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651f.html
点击查看答案
有以下程序
#include
#define FUN1(a,b) a+b
#define FUN2(a,b) a-b
#define CAL(a,b) a*b+a+3
main()
{
printf("%d\n",CAL(FUN1(3,5),FUN2(4,5)));
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346521.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int x=0x02ff,y=0x0ff00;
printf("%d\n",(x&y)>>4|0x005f);
}
执行后的输出结果是( )。
A. 127
B. 255
C. 128
D. 1
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650e.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 a, b;
for(a=1, b=1; a<=100; a++)
{ if(b>=10) break;
if (b%3= =1)
{ b+=3; continue; }
}
printf("%d\n",a);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346524.html
点击查看答案
设一整型(int)变量占用2个字节则下述共用体变量x所占用内存字节数为()。
union exp
{ int i;
float j;
double k;
}x;
A. 14个
B. 7个
C. 8个
D. 随机而定
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346517.html
点击查看答案