-
若有以下程序 #include void f(int n) main() { void f(int n); f(5); } void f(int n); { printf("%d\n",n); } 则以下叙述不正确的是()
A . 若只在主函数中对函数f进行说明,则只能在主函数中正确调用函数f
B . 若在主函数前对函数f进行说明,则在主函数和其它函数中都可以正确调用函数f
C . 对于以上程序,编译时系统会出提示出错信息:提示对f函数重复说明
D . 函数f无返回值,所以可用void将其类型定义为无值型
-
#include void main ( ){ int n = 4 ;while (n--)printf (%d,--n); }
-
#include iostream.h void main() { int j=0; if(j==0) cout<
-
下列程序的运行结果是( ) #include void fun(); int main() { int a=10; fun(); printf(%5d,a); return 0; } void fun() { int a=20; printf(%5d,a); }
-
阅读程序写出结果:#include int fun(double a,double b);void main( ){ cout<
-
以下程序的输出结果是( )。#include void fun(int *p);int main(){int x = 3;fun(&x);printf(“x = %d\n”, x);}void fun(int *p){*p = 5;}
-
阅读程序写出结果#include int add(int x,int y=8);void main( ){ int a=4;cout<
-
下列程序的运行结果是( ) #include void fun ( int k ) ; void main ( ) { int w = 5 ; fun ( w ) ; } void fun ( int k ) { printf ( \%d\ , k ) ; if ( k>0 ) fun ( k-1 ) ; }
-
10.下面程序的输出结果是#include void increment(void);int main(void){increment(); increment(); increment();return 0;}void increment(void){int x = 0;x += 1;printf(\%d \, x);}
-
读程序写结果:#include void fun();void main(){ int i;for(i=0;i<5;i++)fun();}void fun(){ static int m=0;cout<
-
若有以下程序include <stdio.h>void f(int n);main(){ void f(int n); f(5);}void f(int n){ printf("%d\n",n); }则以下叙述中不正确的是
A.若只在主函数中对函数f进行说明,则只能在主函数中正确调用函数f
B.若在主函数前对函数f进行说明,则在主函数和其他函数中都可以正确调用函数f
C.对于以上程序,编译时系统会提示出错信息:对f函数重复说明
D.函数f无返回值,所以,可用void将其类型定义为无返回值型
-
以下程序段的输出结果是[ ]。 include<iostream.h> void ref(int &i); void main(){int val=1
以下程序段的输出结果是 [ ] 。
include<iostream.h>
void ref(int &i);
void main(){
int val=1;
cout<<“旧值:”<<val<<end1;
ref(val);
cout<<”新值:”<<val<<end1;
}
void ref(int &i){i=10;}
-
下述程序的输出结果是()。include<stdio.h> void main{ int b[6]={2,4,6,8,10,12);int*p=
下述程序的输出结果是()。
include<stdio.h>
void main
{ int b[6]={2,4,6,8,10,12);
int*p=b,**q=&p;
printf("%d,",*(p++));
printf("%d,",**q);
}
A.4,4
B.2,2
C.4,5
D.2,4
-
下面程序的运行结果是()。include<iostream.h> void main{int num=1:int&ref=num; ref
下面程序的运行结果是()。
include<iostream.h> void main
{
int num=1:
int&ref=num; ref=ref+2:
cout<<num: num=num+3: cout<<ref<<endl:
}
A.13
B.16
C.36
D.33
-
下列程序的运行结果为include < iostream.h >void main(){ int a=2; int b=a+l; cout < < a/b
下列程序的运行结果为 include < iostream.h > void main() { int a=2; int b=a+l; cout < < a/b < < end1; }
A.0.66667
B.0
C.0.7
D.0.66666666…
-
以下程序的正确运行结果是()。include<iostream.h>int f(int);void main(){int a=2,i;for(i=0;i<
以下程序的正确运行结果是()。 include<iostream.h> int f(int); void main() { int a=2,i; for(i=0;i<3;i++)cout<<f(a)<<" "; cout<<endl; } int f(int a) { int b=0 static int c=3; b++:c++; return(a+b+c); }
A.777
B.7 10 13
C.79 11
D.7 8 9
-
有如下程序include<iostream.h>int func(int a,int b){ return(a+b) ;}void main(){ int x=2,y
有如下程序 include<iostream.h> int func(int a,int b) { return(a+b) ;} void main() { int x=2,y=5,z=8, r; r=func (func(x,y),z); cout << r; } 该程序的输出的结果是
A.12
B.13
C.14
D.15
-
Tilil程序的运行结果是()。 include<iostream.h> void main { int i=1: while(i<=8)
Tilil程序的运行结果是()。 include<iostream.h> void main { int i=1: while(i<=8) if(i%3 1=2)continue: else eout<<i; }
A.25
B.36
C.258
D.369
-
有以下程序 include<iostream.h> floatfun(int x,int y) {return(x+y);}void main() {int a=2,b
有以下程序 include<iostream.h> floatfun(int x,int y) {return(x+y);} void main() {int a=2,b=5,c=8; tout<<fun((int)fun(a+c,b),a-C);} 程序运行后的输出结果是
A.编译出错
B.9
C.21
D.9
-
有以下程序:include<stdlib.h>void fun(int* s,int* * d){* *d=*(s+2);}main(){ inta[]={1,2,3,
有以下程序: include <stdlib.h> void fun(int * s,int * * d) { * *d=*(s+2); } main() { int a[]={1,2,3,4,5},*b; b=(int *)malloc(sizeof(int)); fun(a,&B) ; printf("%d\n",*b+1); } 程序的输出结果是()
A.2
B.3
C.4
D.5
-
下列程序的运行结果为()。 include<iostream.h> void main { int a=2: int b=a+1: co
下列程序的运行结果为()。 include<iostream.h> void main { int a=2: int b=a+1: cout<<a/b<<endl:
A.0.66667
B.0
C.0.7
D.0.66666666…
-
include<iostream.h> void main() { int n=9; while(n>6) { n--; cout < < n;} } 该程
include<iostream.h> void main() { int n=9; while(n>6) { n--; cout < < n;} } 该程序的输出结果是
A.987
B.876
C.8765
D.9876
-
有以下程序:include <stdio, h>void sum(int a[ ] ){a[0]=a[-1] +a[1];}main (){int a[10] = {
有以下程序:include <stdio, h>void sum(int a[ ] ){ a[0]=a[-1] +a[1];}main (){ int a[10] = {1,2,3,4,5,6,7,8,9,10}; sum(&a[2]); prinff("% d \n",a[2]); }程序运行后的输出结果是()。
A.6
B.7
C.5
D.8
-
有以下程序includevoid main(){int a ;scanf("%d",&a);if(a >= 0){if
A.A.-11 is a positive odd number.
B.B.-11 is a negative odd number.
C.C.-11 is a positive even number.
D.D.11 is a negative even number.
-
下面程序的运算结果为()。includevoid fun();int main(){int a=10;fun();printf("%3d",a);return 0;}void fun(){int a=20;printf("%3d",a);}
A.20 10
B. 10 10
C. 10 20
D. 20 20