Chapter 4 Function Declaration and Usage

Chapter 4 Function Declaration and Usage

University

5 Qs

quiz-placeholder

Similar activities

Dasar Koding dan Kecerdasan Artifisial

Dasar Koding dan Kecerdasan Artifisial

11th Grade - University

10 Qs

Caesar Cipher

Caesar Cipher

7th Grade - University

10 Qs

Quiz Pemrograman dan Algoritma

Quiz Pemrograman dan Algoritma

1st Grade - University

10 Qs

1ro B Preguntas sobre IA y Prompts

1ro B Preguntas sobre IA y Prompts

1st Grade - University

10 Qs

ASSESSING HARDWARE

ASSESSING HARDWARE

University

10 Qs

MAD Unit 5 T1

MAD Unit 5 T1

University

10 Qs

Basic Troubleshooting

Basic Troubleshooting

University

10 Qs

Quiz sobre Golpes e Segurança Digital

Quiz sobre Golpes e Segurança Digital

University

10 Qs

Chapter 4 Function Declaration and Usage

Chapter 4 Function Declaration and Usage

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Easy

Created by

MAHANI BINTI ZAKARIA (POLIMAS)

Used 6+ times

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

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

Media Image

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?