Mastering C++ Functions

Mastering C++ Functions

University

15 Qs

quiz-placeholder

Similar activities

Fundamentals

Fundamentals

7th Grade - University

12 Qs

CLC Lesson 7 Quiz

CLC Lesson 7 Quiz

University

12 Qs

HackHarbor 3.0 : Day 1

HackHarbor 3.0 : Day 1

University

16 Qs

Diagnostico Grado Sexto

Diagnostico Grado Sexto

6th Grade - University

18 Qs

Web Programming Quiz in Portuguese

Web Programming Quiz in Portuguese

University

10 Qs

BASIC PC COMPONENTS AND TROUBLESHOOTING  - BATCH 1

BASIC PC COMPONENTS AND TROUBLESHOOTING - BATCH 1

University

15 Qs

CHAPTER 1: SYSTEM ANALYSIS AND DESIGN

CHAPTER 1: SYSTEM ANALYSIS AND DESIGN

University

18 Qs

Mastering C++ Functions

Mastering C++ Functions

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Hard

Created by

Fatma Metwally

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q1. What is the correct syntax for defining a function in C++?

  • int func_name(int x);

  • func_name int(int x);

  • int func_name(int x) { ... };

  • void func_name { int x };

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q2. Which of the following statements about function overloading is true?

Function overloading requires all functions to have exactly the same parameters.

Function overloading can only be done with return types.

Function overloading allows multiple functions with the same name but different parameters.

Function overloading is not supported in object-oriented programming.

3.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a function that takes two integers as parameters and returns their product.

Evaluate responses using AI:

OFF

4.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a program with a function that calculates and returns the average of three integers.

Evaluate responses using AI:

OFF

5.

OPEN ENDED QUESTION

3 mins • 1 pt

Write a function that swaps the values of two integer variables. Use this function in main.

Evaluate responses using AI:

OFF

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q6. What is the return type of a function that does not return a value?

int

float

void

string

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following code. What will be the output?

25

15

30

Error: missing argument for y

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?