Recall & Review
beginner
What are function parameters in C?
Function parameters are variables listed in a function's definition. They act as placeholders for the values (arguments) passed to the function when it is called.
Click to reveal answer
beginner
How do you declare a function with two integer parameters in C?
You write the function name followed by parentheses containing the parameter types and names, for example:
void add(int a, int b) { /* code */ }Click to reveal answer
beginner
What is the difference between parameters and arguments?
Parameters are the variables in the function definition. Arguments are the actual values you pass to the function when calling it.
Click to reveal answer
beginner
Can a function in C have no parameters? How?
Yes. You can declare a function with empty parentheses or with
void inside, like void greet(void). This means the function takes no arguments.Click to reveal answer
intermediate
What happens if you change a parameter value inside a function?
Changing a parameter inside a function only changes the local copy. The original variable passed as an argument outside the function stays the same.
Click to reveal answer
What keyword do you use to specify a function takes no parameters in C?
✗ Incorrect
In C,
void inside the parentheses means the function takes no parameters.If a function is declared as
int sum(int x, int y), what are x and y?✗ Incorrect
x and y are parameters, placeholders for values passed when calling the function.What happens to the original variable if you change a parameter inside a function?
✗ Incorrect
Parameters are copies of arguments, so changing them inside the function does not affect the original variable.
How do you call a function named
printMessage that takes no parameters?✗ Incorrect
You call a function with empty parentheses if it takes no parameters.
Which of these is a correct function parameter list in C?
✗ Incorrect
Parameters are listed by type and name separated by commas without parentheses or semicolons inside the list.
Explain what function parameters are and how they differ from arguments.
Think about the function definition versus the function call.
You got /3 concepts.
Describe what happens when you modify a parameter inside a function in C.
Consider how C handles data passed to functions.
You got /3 concepts.