Operator and Expression  in c programming language
BM Balmiki Mandal 23 Jul 2022 0 views 0 comments C Programming

Operator and Expression in c programming language

Learn about Operators and Expressions in C Programming Language

In C programming language, an operator is a symbol that represents an action or operation to be performed on one or more operands. An expression, on the other hand, is a combination of operators, variables, and literals that can be evaluated to produce a value.

C programming language supports various types of operators, such as arithmetic, relational, logical, bitwise, assignment, and conditional operators. Some examples of these operators are:

 Operator are categorized in 3 ways

Unary operator

 1 operand

binary operator

  2 operand

Tenery operator

   3 operand

 

Depending upon operation operator categories are

  1. Arithmetic Operator
  2. Assignment operator
  3. Relational operator
  4. Logical Operator
  5. Bitwise operator
  6. sizeof operator
  7. increment and decrement Operator
  8. shift operator
  9. conditional operator
  10. reference operator
  11. dereference operator
  12. compound assignment operator
  13. comma operator( , )
  14. dot operator( . )
  15. arrow operator( -> )
  16. index operator( [ ] )
  17. grouping operator ( )

 

Command for see the operator list on Linux environment

$man operator    (manual list of all operators)
$man ASCII        (ASCII list)

 

Before jumping the operator we can see some Examples and rules

Example 01:  c=a+b     

conclusion:  + will do first because of the associativity and priority after that after the assignment operator will perform

 

Note: Whenever you are solving operator we have to encounter priority and associativity

Example 02:  c=a+b*2

conclusion: first perform the highest priority operator here higher priority operator is multiplication after the second highest priority operator addition will perform at  last lowest priority operator will perform. if whenever same priority operator will come at the same time then Associtivity comes into the picture.

Example 03: c=a/b*2

conclusion: here / and * both are the same priority then associativity will low left to right, the division first, multiplication second, assignment last will perform.

 

list of associativity and priority operator

Example 04 :  C   =    A+B  -  D*E  /  F

when a constant and different variable in between same operator is there, then they all are converted into the same operator. the compiler will convert all operands upto the type of the biggest operand 

0 Comments

No comments yet, Be the first to comment.

Post a Comment

Please sign in to post a comment.

Related Posts

Bit wise operators Assignment

Bitwise Operators practical assignment: Take runtime input, bit-level manipulation, and different data units r...

AG Anvesh G 27 Sep 2026
Understanding Float and Double Binary Representation in C

Understanding Float and Double Binary Representation in CIntroduction:When we store decimal numbers such as 10...

AG Anvesh G 31 May 2026
Topic-wise C Programming Interview Questions

C Programming Interview Questions – Topic Wise1. IntroductionC programming is one of the most important langu...

AG Anvesh G 30 May 2026