chapter 5 Basic Concepts of Function in C++

chapter 5 Basic Concepts of Function in C++

University

5 Qs

quiz-placeholder

Similar activities

IT Quiz Bee 2025 - AVERAGE

IT Quiz Bee 2025 - AVERAGE

University

10 Qs

OOP-Q1

OOP-Q1

University

10 Qs

Quiz Diagram Alir dan Algoritma

Quiz Diagram Alir dan Algoritma

1st Grade - University

9 Qs

Email Writing Best Practices Assessment

Email Writing Best Practices Assessment

8th Grade - University

10 Qs

Topic 4.0 Window Operating System

Topic 4.0 Window Operating System

University

10 Qs

Data Types and Conversion Quiz

Data Types and Conversion Quiz

6th Grade - University

4 Qs

Essential Python Knowledge for Students

Essential Python Knowledge for Students

University

7 Qs

Interruptions Quiz

Interruptions Quiz

University

8 Qs

chapter 5 Basic Concepts of Function in C++

chapter 5 Basic Concepts of Function in C++

Assessment

Quiz

Information Technology (IT)

University

Easy

Created by

MAHANI BINTI ZAKARIA (POLIMAS)

Used 3+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the main purpose of using functions in a C++ program?

To increase the size of the program

To slow down the execution

To divide the program into smaller parts

To reduce readability

Answer explanation

Functions help organize code into smaller blocks that are easier to manage and reuse.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which keyword is used to define a function in C++?

define

void

function

return

Answer explanation

The keyword void is used when a function does not return a value. It is part of the function definition.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times can a function be called in a C++ program?

Only once

Twice

As many times as needed

Never

Answer explanation

Functions can be called repeatedly to perform a task, which helps avoid writing the same code again

4.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

What will be the output of this code?

Hello!

Hello!Hello!

Error

Nothing

Answer explanation

Media Image

The function greet() is called twice, so "Hello!" will be printed two times.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which part of the function defines the data type of the returned value?

Function body

Function name

Return type

Parameters

Answer explanation

The return type (e.g., int, void, float) defines what kind of value the function will return.