Quiz for:

Arithmetic Operators in C++

Question 10

What output might you get when dividing by 0.0 in a system following IEEE 754?

A.Syntax error
B.Infinity (INF) or Not a Number (NAN)
C.Compile error
D.Memory leak

Question 1

What are arithmetic operators used for in C++?

A.Perform file operations
B.Perform basic mathematical operations
C.Perform text formatting
D.Perform web-based tasks

Question 2

What types of numeric data can arithmetic operators work with in C++?

A.String and char
B.Boolean and void
C.Int, float, and double
D.Array and pointer

Question 3

What is a unary arithmetic operator in C++?

A.An operator that operates on two values
B.An operator that operates on one value
C.An operator that is used for string manipulations
D.An operator that operates on any number of values

Question 4

Which of the following is an example of a unary arithmetic operator?

A.Addition
B.Subtraction
C.Unary plus
D.Multiplication

Question 5

Why is the unary plus operator not recommended for use in programs?

A.It does not perform any operations
B.It changes the sign of a value
C.It performs addition incorrectly
D.It only works with boolean values

Question 6

What is a binary arithmetic operator in C++?

A.An operator that operates on two values
B.An operator that operates on three values
C.An operator that operates on one value
D.An operator that operates on four values

Question 7

What symbol is used for multiplication in binary arithmetic operators?

A.+
B.-
C.*
D./

Question 8

What result do you get when dividing two integers in C++?

A.A floating-point value
B.An integer value
C.A string representation of the value
D.A boolean value

Question 9

What happens when you divide a number by zero in C++?

A.The operation proceeds normally
B.You get a compile-time error
C.You get a runtime error
D.The number becomes negative

Question 10

What output might you get when dividing by 0.0 in a system following IEEE 754?

A.Syntax error
B.Infinity (INF) or Not a Number (NAN)
C.Compile error
D.Memory leak

Question 1

What are arithmetic operators used for in C++?

A.Perform file operations
B.Perform basic mathematical operations
C.Perform text formatting
D.Perform web-based tasks