Answer
⌊b⌋ - ⌈a⌉ + 1
or
⌈b⌉ - ⌊a⌋ − 1
Work Step by Step
Range: a < n < b
⌊b⌋ is the highest possible integer within the range, while ⌈a⌉ is the lowest possible integer within the range.
So total number of integers would be ⌊b⌋ - ⌈a⌉ + 1 (we need to add 1 because recall if we have {1, 2, 3, 4}, total number of integers would be (highest number - lowest number) + 1 = 4)