[C language] Test 7 function

  1. The type of the following C function is ( ).
    fun (float f ){ printf ( " %f \n " , f ) ; } A. int B. float C. void D. Not sure Correct answer: A






  2. When calling a function, if the actual parameter is a simple variable, the data transfer method between it and the corresponding formal parameter is ( ).
    A. Address transfer
    B. One-way value transfer
    C. From the actual parameter to the formal parameter, and then from the formal parameter to the actual parameter
    D. Specified by the user
    Correct answer: B

  3. The type of the following function value is ( ).
    int fun(float x){ float y; y=3*x-4; return y; } A. int B. Not sure C. void D. float Correct answer: A








  4. The output of the following program is ( ).
    #include <stdio.h>
    void fun(){ int a,b; a=100; b=200; } main(){ int a=5,b=7; fun(); printf(“%d%d \n”,a,b); } A. 100200 B. 57 C. 200100 D. 75 Correct answer: B













  5. The error in the following statement is ( ).
    A. There can be no return statement in the user-defined function
    B.

Guess you like

Origin blog.csdn.net/m0_68111267/article/details/130613757