Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program precedenceOp
- ! this program checks logical operators
- implicit none
- ! variable declaration
- integer :: a, b, c, d, e
- ! assigning values
- a = 20
- b = 10
- c = 15
- d = 5
- e = (a + b) * c / d ! ( 30 * 15 ) / 5
- print *, "Value of (a + b) * c / d is : ", e
- e = ((a + b) * c) / d ! (30 * 15 ) / 5
- print *, "Value of ((a + b) * c) / d is : ", e
- e = (a + b) * (c / d); ! (30) * (15/5)
- print *, "Value of (a + b) * (c / d) is : ", e
- e = a + (b * c) / d; ! 20 + (150/5)
- print *, "Value of a + (b * c) / d is : " , e
- end program precedenceOp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement