0
0
Cprogramming~5 mins

Function calling - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a function call in C?
A function call is when you ask a function to run its code by using its name followed by parentheses, optionally with arguments inside.
Click to reveal answer
beginner
How do you call a function named printMessage in C?
You call it by writing printMessage(); with parentheses and a semicolon.
Click to reveal answer
beginner
What happens if you call a function without the required arguments?
The program will give an error because the function expects certain inputs to work properly.
Click to reveal answer
beginner
Why do we use function calls in a program?
Function calls let us reuse code, keep programs organized, and make the program easier to read and maintain.
Click to reveal answer
intermediate
What is the difference between a function declaration and a function call?
A function declaration tells the program what the function looks like. A function call actually runs the function's code.
Click to reveal answer
How do you call a function named sum that takes two integers in C?
Asum(5, 10);
Bint sum(5, 10);
Ccall sum(5, 10);
Dfunction sum(5, 10);
What does a function call do?
AComments out the function
BRuns the code inside the function
CDeletes the function
DDefines the function
Which of these is a correct function call in C?
AmyFunction();
BmyFunction;
CmyFunction()
Dcall myFunction();
What happens if you forget parentheses when calling a function?
AThe function runs normally
BThe program skips the function
CThe function is declared again
DYou get a syntax error
Why do we pass arguments in a function call?
ATo stop the function
BTo name the function
CTo give the function data it needs
DTo declare the function
Explain in your own words what a function call is and why it is important in C programming.
Think about how you ask a friend to do something for you.
You got /4 concepts.
    Describe the syntax of calling a function with and without arguments in C.
    Remember the example: printMessage(); or sum(5, 10);
    You got /4 concepts.