Online Test : C Programming Part II

25 Questions | Total Attempts: 54

SettingsSettingsSettings
Online Test : C Programming Part II - Quiz

Unit I : Functions


Questions and Answers
  • 1. 
    Any C Program can contain............
    • A. 

      Must contain at least one function

    • B. 

      Need not contain any function

    • C. 

      Needs input data

    • D. 

      None of the above

  • 2. 
    Which of the following is the default parameter passing method?
    • A. 

      Call by value

    • B. 

      Call by reference

    • C. 

      Call by value result

    • D. 

      None of the above

  • 3. 
    A function which calls itself is called.........
    • A. 

      Self function

    • B. 

      Void function

    • C. 

      Recursive function

    • D. 

      Static function

  • 4. 
    What will be the output of following code? # include <stdio.h> void show(); void main() { printf("C Programming"); show(); getch(); } void show() { printf("Language"); }
    • A. 

      C Programming

    • B. 

      C Programming Language

    • C. 

      Language

    • D. 

      Compile Error

  • 5. 
    What are the types of functions in C language?
    • A. 

      Library Funcions

    • B. 

      User defined functions

    • C. 

      Both the above

    • D. 

      None of these

  • 6. 
    Which keyword is used to transfer control from a function back to the calling function ?
    • A. 

      Switch

    • B. 

      Goto

    • C. 

      Return

    • D. 

      Void

  • 7. 
    Which method is used in the following function? int &x;
    • A. 

      X is passed by value

    • B. 

      X is passed by reference

    • C. 

      X is declared outside of the function

    • D. 

      None of the above

  • 8. 
    Which statement is correct about passing by value parameters?
    • A. 

      It cannot changee the actual parameter value

    • B. 

      It can change the actual parameter value

    • C. 

      Psrameter is always read write mode

    • D. 

      All of the above

  • 9. 
    Which statement is correct about passing by value parameters?
    • A. 

      It cannot change the actual parameter value

    • B. 

      It can change the actual parameter value

    • C. 

      Parameters always read-write mode

    • D. 

      None of the above

  • 10. 
    Which of the following is not a storage class in C language?
    • A. 

      Auto

    • B. 

      Extern

    • C. 

      Volatile

    • D. 

      Register

  • 11. 
    ............. is a group of statements that together perform a specific task
    • A. 

      Array

    • B. 

      Function

    • C. 

      Program

    • D. 

      Pointer

  • 12. 
    User defined and.......................... functions are types of functions in C programming.
    • A. 

      Library

    • B. 

      Static

    • C. 

      Array

    • D. 

      Main

  • 13. 
    A scope of variable inside a function is called............
    • A. 

      Local

    • B. 

      Global

    • C. 

      Static

    • D. 

      None of these

  • 14. 
    Printf() and scanf() are examples of ................ type of functions
    • A. 

      User defined functions

    • B. 

      Library functions

    • C. 

      Static functions

    • D. 

      Void functions

  • 15. 
    A/An ...................... is the actual data that we pass to the function parameter
    • A. 

      Argument

    • B. 

      Values

    • C. 

      Parameter

    • D. 

      Values

  • 16. 
    How many function categories in C programming?
    • A. 

      One

    • B. 

      Two

    • C. 

      Three

    • D. 

      Four

  • 17. 
    Which type of following function is? float CalArea(float length, float width) { return length*width; }
    • A. 

      Function with no argument and no return value

    • B. 

      Function with argument and no return value

    • C. 

      Function with no argument and with return value

    • D. 

      Function with argument and with return value

  • 18. 
    How many storage classes in C programming?
    • A. 

      Three

    • B. 

      Four

    • C. 

      Five

    • D. 

      Six

  • 19. 
    The use of Functions in C programming is/are........
    • A. 

      Helps to avoid repeating set of statements many times

    • B. 

      Enhance the logical clearity of the program

    • C. 

      Helps to avoid repeated programming across programs

    • D. 

      All of the above

  • 20. 
    What will be the output of the following program? # include <stdio.h> void test(); void main() { test(); getch(); } test() { printf("Hello"); }  
    • A. 

      Hello

    • B. 

      Complile time Error

    • C. 

      Run time Error

    • D. 

      Infinite loop

  • 21. 
    Which storage class is used for define local variable within function?
    • A. 

      Extern

    • B. 

      Register

    • C. 

      Auto

    • D. 

      Static

  • 22. 
    Which storage class is used to store variable in the register of the microprocessor if a free register is available?
    • A. 

      Auto

    • B. 

      Extern

    • C. 

      Static

    • D. 

      Register

  • 23. 
    A function .............. tells the compiler about a function name and how to call the function 
    • A. 

      Definition

    • B. 

      Declaration

    • C. 

      Function calling

    • D. 

      None of these

  • 24. 
    What is Function?
    • A. 

      Function is a block of statements that perform some specific task

    • B. 

      Function is the fundamental modular unit.

    • C. 

      Function is a block of code has a name and it is reusable.

    • D. 

      All of the above

  • 25. 
    ....................... method copies the address of an argument into the formal parameter.
    • A. 

      Call by value

    • B. 

      Call by reference

    • C. 

      Call by variable

    • D. 

      None of the above

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.