题目内容

【填空题】写出下面程序执行后的运行结果____。#include int a1 = 300, a2 = 400;void sub1( int x, int y ); int main(){ int a3 = 100, a4 = 200; sub1( a3, a4 ); sub1( a1, a2 ); printf( "%d,%d,%d,%d", a1, a2, a3, a4 ); return(0);} void sub1( int x, int y ){ a1 = x; x = y; y = a1;}

查看答案
更多问题

【填空题】若x能被2整除,C语言中表述为 ;。

【填空题】C语言变量按其作用域分为____和____。按其生存期分为____和____。

【填空题】写出下面程序执行后的运行结果____。#include void swap1( int c0[], int c1[] ){ int t; t = c0[0]; c0[0] = c1[0]; c1[0] = t;} void swap2( int *c0, int *c1 ){ int t; t = *c0; *c0 = *c1; *c1 = t;} int main(){ int a[2] = { 3, 5 }, b[2] = { 3, 5 }; swap1( a, a + 1 ); swap2( &b[0], &b[1] ); printf( "%d %d %d %d", a[0], a[1], b[0], b[1] ); return(0);}

【填空题】写出下面程序执行后的运行结果____。#include int SUM( int n ){ if ( n == 1 ) return(1); else return(n * n + SUM( n - 1 ) );} int main(){ printf( "SUM=%d", SUM( 5 ) ); return(0);}

答案查题题库