Expressions - Programming

Q1:

Which of the following correctly shows the hierarchy of arithmetic operations in C?

A / + * -

B * - / +

C + - / *

D / * + -

ANS:D - / * + -

Simply called as BODMAS (Bracket of Division, Multiplication, Addition and Subtraction). How Do I Remember ? BODMAS !

  • B - Brackets first
  • O - Orders (ie Powers and Square Roots, etc.)
  • DM - Division and Multiplication (left-to-right)
  • AS - Addition and Subtraction (left-to-right)