举一反三
- #include [stdio.h] int x,y; int f(int x){ y=x++; printf("%d",y); } int main(void){ int x=5; f(x); f(x); return 0; }
- 下面的函数定义,( )是正确的。 A: void f() { ...... return; } B: void f() { ...... return 0; } C: int f(); { ...... return; } D: double f(int x;int y) { ...... return; }
- 下列程序的运行结果是( )#include <stdio.h>int fun1(int x); void fun2(); int x=5; int main() { int x=1; x=fun1(x); printf("%d",x); return 0; } int fun1(int x) { x++; fun2(); return x; } void fun2() { x++;} A: 6 B: 5 C: 2 D: 7
- Which five methods,inserted independently at line 5,will compile?() A: public int blipvert(int x){return 0;} B: private int blipvert(int x){return 0;} C: private int blipvert(long x){return 0;} D: protected int blipvert(long x){return 0;} E: protected long blipvert(long x){return 0;} F: protected long blipvert(int x, int y){return 0;}
- Given: Which five methods, inserted independently at line 5, will compile?() A: protected int blipvert(long x) { return 0; } B: protected long blipvert(int x) { return 0; } C: private int blipvert(long x) { return 0; } D: private int blipvert(int x) { return 0; } E: public int blipvert(int x) { return 0; } F: protected long blipvert(long x) { return 0; } G: protected long blipvert(int x, int y) { return 0; }
内容
- 0
Given: Which five methods, inserted independently at line 5, will compile?() A: public int blipvert(int x) { return 0; } B: private int blipvert(int x) { return 0; } C: private int blipvert(long x) { return 0; } D: protected long blipvert(int x) { return 0; } E: protected int blipvert(long x) { return 0; } F: protected long blipvert(long x) { return 0; }
- 1
下面的函数定义,( )是正确的。 A: void f() { ...... } B: void f() { ...... return 0; } C: int f(); { ...... } D: double f(int x;int y) { ...... }
- 2
#include int cude( );int main( ){ int x=5;x=cude( );printf("%d\n",x);return 0;}int cude( ){ int x;x=x*x*x; return x;} A: 5 B: 125 C: 0 D: 1
- 3
下面程序的输出结果是_______。 #include void increment(void); int main(void) { increment(); increment(); increment(); return 0; } void increment(void) { int x = 0; x += 1; printf("%d ", x); }
- 4
下面程序的运行结果是a=____,b=____。#include<;stdio.h>;int main( ){void f( int x , int y ) ;int a = 1 , b = 2 ;f( a , b ) ;printf( "a=%d,b=%d\n" , a , b ) ;return 0 ;}void f( int x , int y ){x = 100 ;y = 200 ;}