Monday, 22 January 2018

Operators In C



Symbols that are used to perform some operations in a C program are called Operators.



Operators are categorized as:-

  1. Unary Operator(Uses One Operand)
  2. Secondary Operator(Uses Two Operands)
  3. Ternary Operator (Uses Three Operands)

Type Of Operators In C  :-

Ignore Comma, Comma itself an Operator
  • Arithmetic Operators                  (Exp:- +, -, *, /,%  ) 
  • Relational Operators                   (Exp:- >, >=, <=,<, ==, =!)
  • Logical Operators                       (Exp:- &&, || , ! )
  • Assignment Operators                (Exp:- = )
  • Bit Wise Operators                     (Exp:- &, |, ^, ~ )
  • Size Of Operator                        (Exp:-  sizeof()  )
  • Comma Operator                        (Exp:-    ,    )
  • Inc and Dec Operator                 (Exp:- ++, -- )
  • Conditional Operators                (Exp:- condition?true:false  ) 
  • Address Operator                        (Exp:- &(reference operator )  )
  • De-reference Operator                (Exp:- *  )
Many more are there that will discuss in coming posts.  

Frequently Ask Questions In Interview :-

  1. Tell us 5 Unary Operators.
  2. Example of Ternary operator. (You should take a situation ; then explain)