Announcement

Collapse
No announcement yet.

get the sum of

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • get the sum of

    How do you write the code to get the sum of, or in other words to get the difference between 2 numbers??

    If we have 2 numbers, both with negative values or
    one number with a negative value and one witha positive value,
    or, both with positive values

    do you have to put both a plus sign and a subtraction sign (number a + - number b)

    Thanks,

    John

  • #2
    John
    See examples below
    Alex

    PHP Code:
    var = (-a)+(-b);// to sum
    var = (-a)-(-b);//to subtract 

    Comment

    Working...
    X