How can we subtract two positive or negative integers?


Solution:



Subtracting two positive integers

$ a - b$ where a and b are any two integers such that $a > b$

Example:

$5 - 3 = 2$

$a - b$ where a and b are any two integers such that $b > a$

$3 - 5 = -2$

Subtracting two negative integers

$ (-a) - (-b)$ where a and b are any two positive integers such that $a > b$

Example

$ (-5) - (-3) = -5 + 3 = -2$

$(-a) - (-b)$ where a and b are any two positive integers such that $b > a$

$ (-3) - (-5) = -3 + 5 = +2$

Tutorialspoint
Tutorialspoint

Simply Easy Learning

Updated on: 10-Oct-2022

86 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements