Subtracting the totals of two functions

Hi, Im currently writing a code about laptop rentals, I have a function for Total Laptops, Laptops available at that time & a function for the amount of laptops rented.
In the most basic terms it would be:
LaptopsRented() = LaptopsTotal(i) - LaptopsAvailable(i)
How would I go about this?

Do you want that as another function or in a variable?

Either way you just call the functions like you have written you just need to have that inside a valid code block.

int laptopsRented = LaptopsTotal(i) - LaptopsAvailable(i);

Can we see the entire code? LaptopsTotal() and LaptopsAvailable() are functions, but what does the i represent? what value are you passing to the functions? For readability’s sake it would be best to use a properly named variable and leave the one-letter variables for the loops.

Also would it not be easier to track how many laptops are rented, as you could change that value each time a person rents a laptop. If you wanto to know how much laptops you have left, then you would have to do inventory after each rent. Or are you doing upon rental event LaptopsAvailable -= 1; ?