Operators in C – Questions & Answers

Operators in C

 

  1. Which of the following is an example of compounded assignment statement?
  • a = 5
  • a += 5
  • a = b = c
  • a = b

Ans : 2

  1. The operator && is an example for ___ operator.
  • Assignment
  • Increment
  • Logical
  • Rational

Ans : 3

  1. The operator & is used for
  • Bitwise AND
  • Bitwise OR
  • Logical AND
  • Logical OR

Ans : 1

  1. The operator / can be applied to
  • integer values
  • float values
  • double values
  • All of these

Ans : 2

  1. The equality operator is represented by
  • :=
  • .EQ.
  • =
  • ==

Ans : 4

  1. Operators have hierarchy. It is used to know which operator
  • is most important
  • is used first
  • is faster
  • operates on large numbers

Ans : 2

  1. The bitwise AND operator is used for
  • Masking
  • Comparison
  • Division
  • Shifting bits

Ans : 1

 

 

  1. The bitwise OR operator is used to
  • set the desired bits to 1
  • set the desired bits to 0
  • divide numbers
  • multiply numbers

Ans : 1

  1. Which of the following operator has the highest precedence?
  • *
  • ==
  • =>
  • +

Ans : 4

 

  1. p++ executes faster than p+1 because
  • p uses registers
  • p++ is a single instruction
  • ++ is faster than +
  • None of these

Ans : 2

 

  1. Which operator has the lowest priority?
  • ++
  • %
  • +
  • ||

Ans : 4

  1. Which operator has the highest priority?
  • ++
  • %
  • +
  • ||

Ans : 1

  1. Operators have precedence. A Precedence determines which operator is
  • faster
  • takes less memory
  • evaluated first
  • takes no arguments

Ans : 3

  1. Integer Division results in
  • Rounding the fractional part
  • truncating the fractional part
  • Floating value
  • An Error is generated

Ans : 2

 

 

  1. Which of the following is a ternary operator?
  • ?
  • *
  • sizeof
  • ^

Ans : 1

  1. What will be the output of the expression 11 ^ 5?
  • 5
  • 6
  • 11
  • None of these

Ans : 2

  1. The type cast operator is
  • (type)
  • cast()
  • //
  • ” “

Ans : 1

  1. Explicit type conversion is known as
  • Casting
  • Conversion
  • Disjunction
  • Separation

Ans : 1

  1. The operator + in a+=4 means
  • a = a + 4
  • a + 4 = a
  • a = 4
  • a = 4 + 4

Ans : 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s