题目内容

下面程序的运行结果是________。#includeint main( ){int max( int x , int y ) ;int a = 1 , b = 2 , c ;c = max( a , b ) ;printf( "max is %d\n" , c ) ;return 0 ;}int max( int x , int y ){int z ;z = ( x > y ) ? x : y ;return z ;}

查看答案
更多问题

下面程序的运行结果是________。#includeint main( ){void increment( ) ;increment( ) ;increment( ) ;increment( ) ;return 0 ;}void increment( ){int x = 0 ;x += 1 ;printf( "%d\t" , x ) ;}

下面程序的运行结果是________。#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] ) ;}

答案查题题库