网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
【单选题】有如下程序 main() { int a=2,b=-1,c=2; if(a) c=2; else if(b<0) c=0; else c++; printf(“%dn”,c); } 该程序的输出结果是()。
A.3
B.2
C.1
D.0
参考答案和解析
B 程序使整型指针p1、p2、p3指向a、b、c值所存放的地址空间。然后再将指针变量*p1、*p2中的值的乘积赋给指针变量*p,即赋给变量c,输出c的值3。
更多 “【单选题】有如下程序 main() { int a=2,b=-1,c=2; if(a) c=2; else if(b<0) c=0; else c++; printf(“%dn”,c); } 该程序的输出结果是()。A.3B.2C.1D.0” 相关考题
考题
以下程序运行后的输出结果是( )。main(){int a=2,b=3,c; c=a; if(ab)c=1; else if(a==b)c=0; else c=-1; printf("%d\n",c);}A.1 B.3 C.-1 D.0
考题
下列程序的输出结果是() include main() {int a=3,b=2,c=1; if(a
下列程序的输出结果是( )#include<stdio.h>main(){int a=3,b=2,c=1;if(a<b)if(b<0) c=0;else c++;printf("%d\n",c);}A.0B.2C.1D.3
考题
下列程序的输出结果是( )。#includestdio.hmain{ int a=3,b=2,c=1;if(ab)if(b0)c=0;else c++:printf(%d\n,c);}A.2B.0C.1D.不确定的值
考题
有如下程序:includemain(){int a=2,b= -1,c=2; if(a
有如下程序: #include <stdio.h> main() { int a=2,b= -1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\n",c); } 该程序的输出结果是A.0B.1C.2D.3
考题
下列程序运行后的输出结果是______。 main() { int a=2,b=-1,c=2; if(a<b) if(b<0) c=0; else c++; printf ("%d\n",c);A.0B.1C.2D.3
考题
有如下程序main() { int a=2,b=-1,c=2; if(ab) c=1; if(b0)c=0; else c++; printf("%d\n",c);}该程序的输出结果是A.0 B.1C.2 D.3
考题
下列程序的输出结果是______。 includemain(){ int a=2,b= 1,c=2;if(a
下列程序的输出结果是______。include<stdio.h>main(){ int a=2,b= 1,c=2;if(a<b)if(b<0) c=0;else c++;printf("%d\n",c);}
考题
下列程序的输出结果是()。includemain() { int a=3,b=2,c=1; if(a
下列程序的输出结果是( )。 #include<stdio.h> main() { int a=3,b=2,c=1; if(a<B) if(b<0) c=0; else c++; printf("%d\n",C) ; }A.0B.2C.1D.3
考题
有如下程序: main { int a=2,b=-1.c=2; if(a0)if(b0)c=0; else c++; printf("%d\n",c); } 该程序的输出结果是( )。A.0B.1C.2D.3
考题
有如下程序 long fib(int n) { if(n>2)return(fib(n-1)-fib(n-2)); else return(1); } main() { printf("%d\n",fib(5)); }该程序的输出结果是______。A.-3B.-2C.-1D.0
考题
下面程序的输出结果是 #include stdio.h main(){ int i=2; printf("%d",f(i,i+1) ); } int f(int a,int b) { int c; c=a; if(ab) c=1; else if(a==b) c=0; else c=-1; return(c);}A.-1 B.0 C.1 D.2
考题
若有以下程序main(){ int p=5,a=5; if(p=1!=0) printf("%d\n",p); else printf("%d\n",p+2);}程序执行后的输出结果是
考题
下列程序的输出结果是()。include main () {int a=3,b=2,c=1;if (a
下列程序的输出结果是( )。 #include <stdio.h> main () { int a=3,b=2,c=1; if (a<b) if (b<O) c=0 ; else c++; printf ("%d\n",c); }A.0B.2C.1D.3
考题
下面程序的输出结果是( )。 main() { int i=1,p; p=f(i,++i); printf("%d",p); } int f(int a, int b) { int C; if(a>b) C=1; else if(a==b)C=0; else C==-1; return (C); }A.-1B.0C.1D.2
考题
有以下程序#includemain(){ int x=1,y=0;if(!x) y++;else if(x==0)if (x) y+=2;else y+=3;printf(%d\n,y);}程序运行后的输出结果是A.3B.2C.1D.0
考题
有如下程序 public class Sun { public static void main(String args[ ]) { int a=2,b=1,c=2; if(a<B) if(b<0) if(c<0) c=0; else C++; System.out.println(C) ; } } 上述程序的运行结果是( )。A.0B.1C.2D.3
考题
下列程序的输出结果是()。includemain(){ int a=2,b=3,p;p=f(a,b);printf("%d",p);}int
下列程序的输出结果是( )。 #include<stdio.h> main() { int a=2,b=3,p; p=f(a,b); printf("%d",p); } int f(a,b) { int c; if(a>b)c=1; else if(a==b)c=0; else c=-1; return(c) ; }A.-1B.0C.1D.2
考题
有以下程序#includestdio.hmain(){ int a=1,b=0;if(--a)b++;else if(a==0) b+=2;else b+=3:printf("%d\n",b);}程序运行后的输出结果是A.0B.1C.2D.3
考题
下列程序的输出结果是( )。 #includestdio.h main( ) { int a=2,b=3,P; p=f(a,b); printf(”%d”,p); } int f(a,b) { int c; if(ab)c=1; else if(a==b)c=0; else c=-l; return(c); }A.-lB.0C.1D.2
考题
下列程序的输出结果是( )。 #includestdio.h main { int a=3,b=2,c=1; if(ab) if(b0)c=0; else c++: printf("%d\n",c); }A.2B.0C.1D.不确定的值
考题
有如下程序:main{ int a=2,b=-1.c=2;if(ab)if(b0)c=0;else c++;printf(%d\n,c);}该程序的输出结果是( )。A.0B.1C.2D.3
考题
试题18有以下程序#include stdio.hmain(){ int a=1,b=0;if(- -a) b++;else if(a= =0) b+=2;else b==3;printf(“%d\n”, b);}程序运行后的输出结果是()A.0B.1C.2D.3
考题
单选题有如下程序:#include main(){ int a =0,b=1; if(a++b++) printf(T); else printf(F); printf(a=%d,b=%d,a,b); printf();}程序运行后的输出结果是( )。A
Ta=1,b=2B
Fa=0,b=2C
Fa=1,b=1D
Ta=0,b=1
考题
单选题有以下程序:#include main(){ int x=1,y=0; if(!x)y++; else if(x==0) if(x)y+=2; else y+=3; printf(%d,y);}程序运行后的输出结果是( )。A
3B
2C
1D
0
考题
单选题有如下程序:#include main(){ int a =0,b=1; if(++a==b++) printf(T); else printf(F); printf(a=%d,b=%d,a,b); printf();}程序运行后的输出结果是( )。A
Ta=0,b=1B
Fa=1,b=2C
Ta=1,b=2D
Fa=0,b=2
考题
单选题有以下程序:#includemain(){ int a=1,b=0; if(--a) b++; else if(a==0) b+=2; else b+=3; printf(%d,b);}程序运行后的输出结果是( )。A
0B
1C
2D
3
热门标签
最新试卷