Search Header Logo

II ECM_Quiz 1

Authored by MARY T

Education

University

Used 1+ times

II ECM_Quiz 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to perform operator overloading in C++?

a) overload

b) operator

c) override

d) overloading

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following operators cannot be overloaded in C++?

a) =

b) +

c) &

d) *

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of operator overloading in C++?

a) To create new operators

b) To change the behavior of existing operators

c) To increase code complexity

d) To improve program performance

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following is not a valid return type for an overloaded operator function?

  1. a) void

  1. b) int

c) float

d) bool

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which operator is used to overload the addition operation in C++?

  1. a) +

  1. b) +=

  1. c) =

  1. d) &

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following is the correct syntax to overload the << operator for output?

  1. a) ostream& operator<<(ostream& os, const MyClass& obj)

  1. b) ostream operator<<(ostream os, const MyClass& obj)

  1. c) void operator<<(ostream& os, const MyClass& obj)

  1. d) MyClass& operator<<(ostream& os, const MyClass& obj)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following is not a unary operator?

  1. a) +

  1. b) -

  1. c) *

  1. d) /

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?