GeekInterview.com
  I am new, Sign me up!
 
Home C
 

Operator, Operand and Expression in C

 
Category: C
Comments (1)


Operator, Operand, and Expression in 'C'


Operators are symbols which take one or more operands or expressions and perform arithmetic or logical computations.


Types of operators available in C are as follows:


  • Arithmetic
  • Assignment
  • Logical/relational
  • Bitwise

These have operators under each as follows:


Arithmetic Operators


+ For performing Addition
- For performing Subtraction
/ For performing Division
* For performing Multiplication
% Modulo for finding remainder in division operation
-- Decrement (post and pre)
++ Increment (post and pre)


Assignment Operators


=
*= Multiply
/= Divide
%= Modulus
+= Add
-= Subtract


Logical / Relational Operators


== Equal to
!= Not Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
&& Logical AND
|| Logical OR
! Logical NOT


Bitwise Operators


& AND
| Inclusive OR
^ Exclusive OR
<< Shift Left
>> Shift Right
~ One's compliment


Operands are variables or expressions which are used in operators to evaluate the expression.


Combination of operands and operators form an Expression.


For instance a = b + c; denote an expression in which there are 3 operands a, b, c and two operator  + and =.


The association of expressions and keywords is called Statements.


For instance int a = b + c; denote a statement..



Read Next: Prefix and Postfix Operator



 

 

Comments


murugammal said:

  introduction priority of operators and their clubbing
November 22, 2008, 8:21 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact  

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape