chapter 5 Function Behavior Quiz3

chapter 5 Function Behavior Quiz3

University

5 Qs

quiz-placeholder

Similar activities

Information Management

Information Management

University

10 Qs

CHFI Module 1

CHFI Module 1

University

10 Qs

Animation Techniques Quiz

Animation Techniques Quiz

10th Grade - University

10 Qs

ADBM_Quiz_2_C

ADBM_Quiz_2_C

University

10 Qs

End-Digital Marketing

End-Digital Marketing

University

10 Qs

PAW.09 - DOM Javascript

PAW.09 - DOM Javascript

University

10 Qs

Pre-test Capcut (yippie)

Pre-test Capcut (yippie)

University

10 Qs

MM-Intro

MM-Intro

University

10 Qs

chapter 5 Function Behavior Quiz3

chapter 5 Function Behavior Quiz3

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Hard

Created by

MAHANI BINTI ZAKARIA (POLIMAS)

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following function calls is correct if you have this prototype:

float average(int, int);

average(3, 5.5);

average("3", "5");

average(3, 5);

average();

Answer explanation

Both arguments should be integers to match the prototype.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code?

Welcome, Ali

Hello Ali

Error

Welcome

Answer explanation

The function prints a message using the value passed as the name parameter.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code?

25

10

5

error

Answer explanation

The function multiplies 5 by 5 and returns 25.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to pass control back from a function to the calling function?

back

continue

return

break

Answer explanation

return is used to end the function and send back a value to the caller.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the parameters in a function?

To define the return type

To give the function a name

To receive input values

To print output

Answer explanation

Parameters act like input containers that the function uses for calculations.