网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
以下程序的正确运行结果是(  )。
A

4,5,6

B

6,7,9

C

7,8,9

D

7,7,7


参考答案

参考解析
解析:
主函数中在for循环中依次调用三次fun函数。定义c为静态变量,并初始化为3。变量b为fun函数内部的局部变量,只在fun函数体内有效。第一次循环的返回值为2+1+4=7,第二次循环的返回值为2+1+5=8,第三次循环的返回值为2+1+6=9,故输出结果为789。
更多 “单选题以下程序的正确运行结果是(  )。A 4,5,6B 6,7,9C 7,8,9D 7,7,7” 相关考题
考题 有以下程序 include main( ) { printf("%d\n",NULL); } 程序运行后的输出结果是 有以下程序#include <stdio.h>main( ){ printf("%d\n",NULL); }程序运行后的输出结果是A.0B.1C.-1D.NULL没定义,出错

考题 有以下程序inculde stdio.hmain(){ int a[3][3]={(1,2,3),(4,5,6),(7,8,9)};int B[3]={0},i;For(i=0;i3;i ++) B[i]=a[i][2]+a[2][i];For(i=0;13;i ++) printF(“%d”,B[i]);printF(“\n”);}程序运行后的输出结果是【1】。

考题 有以下程序:include main(){ printf("%d\n",NULL);}程序运行后的输出结果是()。A.0B.1C 有以下程序: #include<stdio.h> main() { printf("%d\n",NULL);} 程序运行后的输出结果是( )。A.0B.1C.-1D.NULL没定义,出错

考题 以下程序的正确运行结果是()。includeint fun(int);void main(){int a=2,i;for(i=0; 以下程序的正确运行结果是( )。 #include<iostream.h> int fun(int); void main() { int a=2,i; for(i=0;i<3;i++) cout<<fun(a)<<end1; cout<<end1; } int fun(int a) { int b=0; static int c=3; b++;c++; return(a+b+c); }A.4,5,6B.6,7,9C.7,8,9D.7,7,7

考题 有一段C程序如下,执行后,其运行结果为(52)。 int f(int a){ auto int b = 0; static int c = 3; b ++; c++; return(a+b+c); } main(){ int a=2,i; for(i=0; i<3; i++)printf("%d, ",f(a)); }A.7,8,9,B.7,7,7,C.6,7,8,D.9,8,7,

考题 有如下程序段struct abc{ int a, b, c, s;};main(){ struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t);}程序运行后输出的结果是A.5 B.6 C.7 D.8

考题 有以下程序: 程序运行后的输出结果是( )。 A.3,3,3B.2,2,3C.1,2,3 有以下程序:程序运行后的输出结果是( )。A.3,3,3B.2,2,3C.1,2,3D.1,l,3

考题 有以下程序: 运行后的输出结果是( )。A.MtemoonB.AftemoonC.MorningSXB 有以下程序:运行后的输出结果是( )。A.MtemoonB.AftemoonC.MorningD.orning

考题 有以下程序: 程序运行后的输出结果是( )。A.11,12B.12,13C.13,14SXB 有以下程序:程序运行后的输出结果是( )。A.11,12B.12,13C.13,14D.14,11

考题 有以下程序程序的运行结果是( )。A.2B.1C.3D.4

考题 有以下程序程序的运行结果是( )。A.AB.BC.CD.D

考题 有以下程序 程序运行后的输出结果是( )。A.程序错无输出结果B.31.5C.7.5SXB 有以下程序程序运行后的输出结果是( )。A.程序错无输出结果B.31.5C.7.5D.14.0

考题 有以下程序(注:字符a的ASCIl码值为97) } 程序运行后的输出结果是( )。A.789B.abcSXB 有以下程序(注:字符a的ASCIl码值为97)}程序运行后的输出结果是( )。A.789B.abcC.7890D.979899

考题 有以下程序:程序运行后的输出结果是( )。

考题 下面程序运行后的输出结果是______。 struct abc { int a,b,c; } main() { struct abc s [2]={{1,2,3},{4,5,6}}; int t=-s[0].a+s[1].b; printf("%d\n",t); }A.5B.6C.7D.8

考题 以下程序的输出结果是( )。 int a=7,b,C; b=++a; C=a++; printf("%d,%d,%d",a,b,C);A.7,8,9B.7,9,9C.9,8,8D.8,7,8

考题 有以下程序:includeusingnamespacestd;int main (){ int a[]={1,2,3, 4,5, 6, 7,8,9, 有以下程序: #include<iostream> using namespace std; int main () { int a[]={1,2,3, 4,5, 6, 7,8,9, 10, 11, 12}; int *p=a+5, *q=0; *q=* (p+5); cout<<*p<<" "<<*q<<end1; return 0; }A.运行后报错B.66C.6 12D.5 5

考题 下列程序运行后的输出结果是()。includevoid fun(int,int,int*);void main(){int x, 下列程序运行后的输出结果是( )。 #include<iostream.h> void fun(int,int,int*); void main() { int x,y,z; fun(5,6,x); fun(7,x,y); fun(x,y,z); cout<<x<<","<<y<<","<<z<<endl; } void fun(int a,int b,int *c) { b+=a; *c=b-a; }A.5,5,5B.6,6,6C.5,6,7D.7,7,7

考题 有以下程序程序的运行结果是A.DB.CC.BD.A

考题 有以下程序: 程序运行后的输出结果是( )。 A.zB.0C.元素eh[5]的地址SXB 有以下程序:程序运行后的输出结果是( )。A.zB.0C.元素eh[5]的地址D.字符Y的地址

考题 若有如下程序: sub(int *t,int a[3][4]) { int m,n; for(m=0;m<3;m++) for(n=0;n<4;n++) { *t=a[m][n];t++;} } main() { int*t,s[3][4)={{1,2,3),{4,5,6),{7,8,9}}; t=(int*)malloc(50); sub(t,s); printf("%d,%d\n",t[4],t[7]); } 则程序运行后的输出结果是( )。A.4,7B.4,0C.5,8D.程序错误

考题 以下程序运行后的输出结果是( )。 A.EFGHIJABCDB.bcdefghijC.abdefCghijS 以下程序运行后的输出结果是( )。A.EFGHIJABCDB.bcdefghijC.abdefCghijD.不确定的值

考题 ( 11 )有以下程序#include stdio.hmain (){ int a[3][3]={{1,2,3},{4,5,6},{7,8,9}};int b[3]={0},i;for ( i=0;i3;i++ ) b[i]=a[i][2]+a[2][i];for ( i=0;i3;i++ ) printf ( " %d " ,b[i] ) ;printf ( " \n " ) ;}程序运行后的输出结果是 【 11 】 。

考题 ● 有一段C 程序如下,执行后,其运行结果为 (52) 。int f(int a) {auto int b = 0;static int c = 3;b ++; c++;return(a+b+c);}main() {int a=2,i;for(i=0; i3; i++) printf("%d, ",f(a));}(52)A. 7,8,9,B. 7,7,7,C. 6,7,8,D. 9,8,7,

考题 给定元组演算表达式 R*={t│(Эu)(R(t)∧S(u)∧t[3] A. A.R*={(3,7,11),(5,9,13),(6,10,14)} B. R*={(3.7.11),(4.5.6),(5.9.13),(6,10,14)} C. R*={(1,2,3),(4,5,6),(7,8,9)} D. R*={(1,2,3),(4,5,6),(7,8,9),(10,11,12)}

考题 A=[1,2,3;4,5,6;7,8,9];A(:,[1,3])=[];A=()

考题 填空题A=[1,2,3;4,5,6;7,8,9];A(:,[1,3])=[];A=()