下面程序的运行结果是________。#includeint main( ){int f( int a ) ;int a = 2 , i ;for( i = 0 ; i < 3 ; i++ )printf( "%4d" , f( a ) ) ;return 0 ;}int f( int a ){int b = 0 ;static int c = 3 ;b++ ;c++ ;return ( a + b + c ) ;}
查看答案
下面程序的运行结果是________。#includeint main( ){int func( int a , int b ) ;int k = 4 , m = 1 , p ;p = func( k , m ) ;printf( "%d\t" , p );p = func( k , m ) ;printf( "%d\n" , p );return 0 ;}int func( int a , int b ){static int m = 0 , i = 2 ;i += m + 1 ;m = i + a + b ;return m;}
下面程序的运行结果是________。#includeint a[3] ;int main( ){void f1( ) ;void f2( ) ;void print( ) ;f1( ) ;print( ) ;f2( ) ;print( ) ;return 0 ;}void f1( ){int i ;for ( i = 0 ; i < 3 ; i++ )a[i] = i ;}void f2( ){int i ,a[3] ;for ( i = 0 ; i < 3 ; i++ )a[i] = i +3;}void print( ){int i ;for ( i = 0 ; i < 3 ; i++ )printf( "%3d" , a[i] ) ;}
有以下程序:#include void fun(int a[ ], int n){int i, t;for (i = 0; i < n / 2; i++){ t = a[i] ; a[i] = a[n - 1 - i] ; a[n - 1 - i] = t ;}}main( ){int k[10] = {1,2,3,4,5,6,7,8,9,10}, i ;fun(k, 5) ;for (i = 2; i < 8; i++)printf("%d", k[i]) ;printf("\n") ;}程序的运行结果是____________。
有以下程序:#include void fun2(char a, char b){printf("%c%c", a, b);}char a = 'A', b = 'B';void fun1(){a = 'C'; b = 'D';}main( ){fun1( );printf("%c%c", a, b);fun2('E', 'F');}