Skip to content
KALANBLON
Show contents

Chapter 3 of 7 · 10 min

Quiz: functions and arrays

Functions, prototypes, pass-by-value, arrays and strings: let's check that you know how to split and store. You need 70% correct answers.

Quiz

6 questions · pass mark: 70%

  1. 1.What does this program display?

    One answer

    void twice(int n) {
        n = n * 2;
    }
    
    int main(void) {
        int x = 4;
        twice(x);
        printf("%d\n", x);
        return 0;
    }
  2. 2.What is a prototype like int square(int x); at the top of the file for?

    One answer

  3. 3.In int t[5], which indexes are valid?

    One answer

  4. 4.How many boxes does the string "Accra" take (end marker included)? Answer with a number.

    Complete the code

  5. 5.Which statements are true? (several answers)

    Several answers possible

  6. 6.What does a function declared void show(int n) return?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.