Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 960 Bytes

OrderOfOperations-C++.md

File metadata and controls

25 lines (21 loc) · 960 Bytes

Order Of Operations

  • C does not just process the statements you send it blindly from left to right. It looks at the statements and applies standard rules to the order in which the statements should be processed. For instance, it will do multiplication before addition.

  • There are many more symbols and operations you will learn as you progress with your knowledge of C, but here is a list of the order for the operations we have gone over in this lesson.

  • Looking at the table below, the operations with priority 1 will be performed first. Then priority 2, 3, and so on will be processed. For operators of the same level of priority, they operations occur from left to right.

Priority Symbol

  1.     ++
    
  2.     --
    
  3.     ()
    
  4.     !
    
  5.     (typecast)
    
  6.     *
    
  7.     /
    
  8.     %
    
  9.     +
    
  10.     -
    
  11.     <, <=
    
  12.     >, >=
    
  13.     ==, !=
    
  14.     &&
    
  15.     ||
    
  16.     all assignment operators