
Chapter 4 Function Declaration and Usage

Quiz
•
Information Technology (IT)
•
University
•
Hard
MAHANI BINTI ZAKARIA (POLIMAS)
FREE Resource
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is a function prototype?
A function call
A function with no name
A declaration of a function before main()
A loop
Answer explanation
A function prototype tells the compiler about the function's name, return type, and parameters before it is used.
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following is a valid function declaration?
int sum(int a, int b);
function sum(int a, int b);
sum(int a, int b);
int sum;
Answer explanation
This correctly defines the return type, function name, and parameter types.
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following statements is true about return statements?
All functions must return a value
Only main() uses return
void functions do not use return value
You can return multiple values using return
Answer explanation
void means the function does not return anything, so no value is used with the return statement.
4.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
What will be the output of this code?
7
34
Error
Nothing
Answer explanation
The function add(3, 4) returns 7, which is then printed.
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the name of the values passed into a function?
Return type
Variables
Arguments or Parameters
Function name
Answer explanation
Values passed into a function are called arguments or parameters.
Similar Resources on Wayground
10 questions
17-02-2025 Class recall

Quiz
•
University
8 questions
Empowerment Technologies Summative Test 5 - Week 5

Quiz
•
12th Grade - University
10 questions
Code Twisters Round 1 Demo

Quiz
•
University
10 questions
C-Volution (Hard)

Quiz
•
University
10 questions
Teste de revisão - Liguagem C

Quiz
•
University
9 questions
CPP-TESTING

Quiz
•
University
10 questions
Class Activity

Quiz
•
University
10 questions
Python Data Types Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University