Chapter 4 Function Declaration and Usage

Chapter 4 Function Declaration and Usage

University

5 Qs

quiz-placeholder

Similar activities

Quiz sobre Minería de Datos

Quiz sobre Minería de Datos

University

10 Qs

Contadores y Acumuladores

Contadores y Acumuladores

University

10 Qs

Struktur Data

Struktur Data

University

10 Qs

Ethics in Research Quiz

Ethics in Research Quiz

University

10 Qs

TEST 09

TEST 09

University

10 Qs

Conhecimentos sobre o App Inventor

Conhecimentos sobre o App Inventor

9th Grade - University

10 Qs

Características de la información de Internet

Características de la información de Internet

University

10 Qs

DB-Quiz1

DB-Quiz1

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?