placeholder image to represent content

W11: CP07 Quiz (BECC0302)

Quiz by Bryan N. Manalaotao

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
15 questions
Show answers
  • Q1
    What is a function in C++?
    A group of statements performing a task
    A code declaration
    A data type
    A loop structure
    30s
  • Q2
    Which function is mandatory in every C++ program?
    execute()
    main()
    begin()
    start()
    30s
  • Q3
    What does a function declaration in C++ consist of?
    Function parameters only
    Function body and parameters
    Function name and return type
    Function name and body
    30s
  • Q4
    What keyword is used for functions that do not return a value in C++?
    double
    int
    char
    void
    30s
  • Q5
    Which of the following is NOT a part of a function definition in C++?
    Return type
    Function call
    Parameters
    Function name
    30s
  • Q6
    How are function parameters passed in C++ by default?
    Call by reference
    Call by name
    Call by value
    Call by pointer
    30s
  • Q7
    What is the purpose of a function declaration in C++?
    To define the return body
    To tell the compiler about the function name and how to call it
    To call the function
    To declare variables
    30s
  • Q8
    Which function is used to concatenate two strings in C++?
    memcpy()
    strcat()
    strcpy()
    strcat_s()
    30s
  • Q9
    What is the correct syntax for defining a function in C++?
    function_name {function body}
    function_name return_type(parameter list) {function body}
    return_type function_name {function body}
    return_type function_name(parameter list) {function body}
    30s
  • Q10
    How are changes made to parameters inside a function affected when using call by value?
    They create a new argument
    They generate a compilation error
    They have no effect on the argument passed to the function
    They affect the argument passed to the function
    30s
  • Q11
    What is the purpose of a function body in C++?
    To define what the function does
    To define function parameters
    To declare variables
    To define the return type
    30s
  • Q12
    Which method of copies the reference in C++ allows changes made to parameters inside a function to affect the argument?
    Call by reference
    Call by pointer
    Call by name
    Call by value
    30s
  • Q13
    What is the function signature in C++?
    Function body
    Return type
    Function name
    Function name and parameter list
    30s
  • Q14
    What happens when a function is called in C++?
    The function is defined and executed
    The program stops execution
    The main function is invoked
    Program control is transferred to the called function
    30s
  • Q15
    What does a function declaration include in C++?
    Function name
    Function name, parameter list, and return type
    Function body and parameters
    Function parameters only
    30s

Teachers give this quiz to your class