Why getting the gallons left in my code result in the same value as adding gallons? The final line that should be output after running this ought to be the fuel after subtracting (miles driven / efficiency in miles per gallon). So it should be less than 32, but it isn't.
On line 25 you wrote fuel -+ gallonsUsed but meant fuel -= gallonsUsed. Such typos are really easy to overlook without help.
If you enable compiler warnings, your compiler can help you avoid many similar mistakes in the future. For example, after turning warnings on, GCC reports
main.cpp:25:7: warning: statement has no effect [-Wunused-value]
Also note that all your arithmetic is integer-based. Maybe this is not a concern for this assignment, but if your 'efficiency' is 42 and you drive 93 miles, 93/42 in integer arithmetic is 2 gallons, not 2.21 gallons. To store partial gallons, you'd need to use floating-point numbers (double).