Search Header Logo

Relational Operators in C Language

Authored by Sartaj Khan

Others

University

Used 4+ times

Relational Operators in C Language
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid relational operator in C? A) == B) = C) := D) !=! Answer: A

==>

A

<>

=

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the '!=' operator do in C? A) Assigns a value B) Checks if two values are equal C) Checks if two values are not equal D) Performs logical NOT Answer: C

Compares two values for greater than

Checks if two values are similar

C

Checks if one value is null

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the expression (5 > 3) in C? A) 0 B) 1 C) 5 D) 3 Answer: B

4

1

6

2

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which relational operator checks if the left operand is less than or equal to the right operand? A) >= B) <= C) == D) <> Answer: B

B

<=

>=

==

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: printf("%d", 4 == 4); A) 4 B) 0 C) 1 D) True Answer: C

4.0

False

2

1

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If int a = 10, b = 20; what is the result of (a >= b)? A) 1 B) 0 C) 10 D) 20 Answer: B

15

2

5

B

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly compares two variables x and y for equality in C? A) if(x = y) B) if(x == y) C) if(x === y) D) if(x.equals(y)) Answer: B

if(x != y)

if(x is y)

if(x < y)

B

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?