Exercises

Function Parameters Across Python, Ruby, Java, and C

Explore how Python, Ruby, Java, and C handle function and method parameters. This quiz examines pass-by-value semantics, shared object references, mutation, reassignment, C pointers, array parameters, keyword arguments, and variadic positional parameters. Questions range from basic syntax to practical code tracing and comparisons among the four languages.

Answer the questions below and check the explanation for each answer.

0/6 answered

  1. 1

    What is the value of numbers after this Python function call?

    Question 1
  2. 2

    In Java, int score is 7 and a method receives score, then increments its parameter. What is score after the call?

  3. 3

    Which C function declaration can swap two caller-owned int variables?

    Question 3
  4. 4

    What is name after this Ruby method reassigns its parameter?

  5. 5

    A Java Box has value 1. What value remains after change executes b.value = 9, then reassigns b to a new Box?

  6. 6

    Inside a C function declared with int data[], what does sizeof(data) usually measure?

    Question 6

Video Courses

Courses related to this topic

See all video courses

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate