Search Header Logo

Quiz - 6 on Relational & Logical Operators

Authored by Michael Kona

Computers

12th Grade

Used 7+ times

Quiz - 6 on Relational & Logical Operators
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the comparison operator for 'equal to' in C?

==

!=

<>

===

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the logical AND operator in C?

&&

&

&|

||

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the logical OR operator in C?

&

||

&&

!

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the logical NOT operator in C?

-

NOT

!

~

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you combine logical AND and OR operators in C?

Use AND for & and OR for |

Use && for AND and || for OR

Use AND for && and OR for ||

Use & for AND and | for OR

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the order of precedence for operators in C?

Logical AND || > Logical OR &&

Multiplication / > Division *

Parentheses () > Postfix increment and decrement ++ -- > Prefix increment and decrement ++ -- > Unary plus and minus + - > Logical NOT ! > Bitwise NOT ~ > Multiplication * > Division / > Modulus % > Addition + > Subtraction - > Left shift << > Right shift >> > Less than < > Less than or equal to <= > Greater than > > Greater than or equal to >= > Equal to == > Not equal to != > Bitwise AND & > Bitwise XOR ^ > Bitwise OR | > Logical AND && > Logical OR || > Conditional ?: > Assignment = += -= *= /= %= &= ^= |= <<= >>= > Comma ,

Bitwise OR & > Bitwise XOR ^

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Give an example of using a relational operator in C.

if (x == y) { // do something }

while (x != y) { // do something }

switch (x < y) { // do something }

for (x > y) { // do something }

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?

Discover more resources for Computers