Chapter 4 Function Declaration and Usage

Chapter 4 Function Declaration and Usage

University

5 Qs

quiz-placeholder

Similar activities

Asesmen Diagnostik SUMIFS

Asesmen Diagnostik SUMIFS

8th Grade - University

10 Qs

Java Quiz 1 in tamil theme

Java Quiz 1 in tamil theme

University

10 Qs

Quizzi bài 29 Tin học 10

Quizzi bài 29 Tin học 10

10th Grade - University

10 Qs

Quiz on Basics of C

Quiz on Basics of C

University

10 Qs

Quiz Meet 3 Mini SC Programing

Quiz Meet 3 Mini SC Programing

University

10 Qs

Kuis Pointer 1

Kuis Pointer 1

University

6 Qs

EXCEL TEST

EXCEL TEST

University

10 Qs

Intro to JS: Variables & Values

Intro to JS: Variables & Values

11th Grade - University

8 Qs

Chapter 4 Function Declaration and Usage

Chapter 4 Function Declaration and Usage

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

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

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.