C++ Functions Quiz

C++ Functions Quiz

University

5 Qs

quiz-placeholder

Similar activities

Refresh balik untuk triaxial

Refresh balik untuk triaxial

University

2 Qs

Pre-Quiz on PID Controllers

Pre-Quiz on PID Controllers

University

10 Qs

Quiz 3 KMK30103

Quiz 3 KMK30103

University

7 Qs

Basic Electronics Quiz 1 (113ES)

Basic Electronics Quiz 1 (113ES)

University

10 Qs

BDF20403 (QUIZ)

BDF20403 (QUIZ)

University

10 Qs

Understanding Supervised Learning

Understanding Supervised Learning

University

10 Qs

Automation

Automation

University

10 Qs

CNN Layer

CNN Layer

University

10 Qs

C++ Functions Quiz

C++ Functions Quiz

Assessment

Quiz

Engineering

University

Hard

Created by

Kalpani H

Used 2+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function in C++?

A group of statements with a name that can be called

A data structure

A type of variable

A loop structure

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to define a function?

type name { parameters }

type name(parameters) { statements }

typename (parameters) { statements }

function type name(parameters) { statements }

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if a function is called before it is declared?

The program will throw a runtime error

The program will not compile

The program will compile successfully

The function will execute but return an error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a function prototype?

To execute the function

To call the function

To declare the function without defining it

To define the function completely

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the function 'subtraction(int a, int b)' when called with arguments (7, 2)?

7

3

9

5