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

Mastering C++ Functions

Quiz
•
Information Technology (IT)
•
University
•
Hard
Fatma Metwally
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
Consider the following code. What will be the output?
25
15
30
Error: missing argument for y
Create a free account and access millions of resources
Similar Resources on Quizizz
18 questions
Python Library Routines Quiz

Quiz
•
10th Grade - University
10 questions
Code Twisters Round 1 Demo

Quiz
•
University
20 questions
DSA (QUIZ 6) Hashing, Graphs, Advanced Graph Algorithms, and DP

Quiz
•
University
10 questions
C-Volution (Hard)

Quiz
•
University
10 questions
Quiz CG - Code V2

Quiz
•
University
20 questions
C-Volution (Intermediate)

Quiz
•
University
20 questions
2F-1 | Python Quiz | 14/10/2024

Quiz
•
University
16 questions
Java Basics Quiz for CH/PT Students

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade