下列程序的运行结果为________。 #include "stdio.h" #define MA(x) x*(x-1) void main() { int a=1,b=2; printf("%d",MA(1+a+b)); }
8
举一反三
- 有以下程序 #include <stdio.h> void fun(int x) {if(x/2>1) fun(x/2); printf("%d",x); } main() {fun(7); printf(" ");} 程序运行后的输出结果是:
- #include <;stdio.h>;int fun(int x);int main(){ printf("%d",fun(4)); return 0;}int fun(int x){ if(x==1)return 3; return x*x+fun(x-1);}程序输出结果为( )
- 阅读下列程序,写出运行结果 。#include <;stdio.h>;main ( ){ int x=1, y=10;if(x!=2) y=y+2;else y=y*2;printf("%d", y);}
- 下列程序的运行结果是( )#include <stdio.h>int fun1(int x); void fun2(); int x=5; int main() { int x=1; x=fun1(x); printf("%d",x); return 0; } int fun1(int x) { x++; fun2(); return x; } void fun2() { x++;} A: 6 B: 5 C: 2 D: 7
- 以下程序运行后的输出结果是________。 #include "stdio.h" int f(int x); void main() { int n=1,m; m=f(f(f(n))); printf("%d",m); } int f(int x) {return x*2;}: 1/#/2/#/4/#/8
内容
- 0
有以下程序: #include <stdio.h> main() { int x=1, y=2, z=3; if(x>y) printf("% d", y<x 1:2); else printf("% d", z<x 2:3); } 程序的运行结果是______。 A: 1 B: 2 C: 3 D: 4
- 1
下列程序的运行结果是______ 。#include void main() { int n=0,m=1,x=2; if(!n) x-=1; if(m) x-=2; if(x) x-=3; printf("%d\n",x); }
- 2
有以下程序 (递归)#include<;stdio.h>;void fun(int x){if(x/2>;1)fun(x/2);printf("%d",x);}main() {fun(7);printf("\n");} A: 137 B: 731 C: 73 D: 37
- 3
【填空题】写出下面程序执行后的运行结果____。#include <;stdio.h>;int main(){ int n=0,m=1,x=2; if(!n) x-=1; if(m) x-=2; if(x) x-=3; printf("%d",x); return 0;}
- 4
以下程序执行后输出结果是( )。 #include "stdio.h" void main() { int n=0,m=1,x=2; if(!n) x-=1; if(m) x-=2; if(x) x-=3; printf("%d\n",x); }