Because line 11 would attempt to use an uninitialized value, your program would engender undefined behavior.
Nobody can explain your program's behavior in terms of the C++ standard if it causes undefined behavior; it's like dividing by zero and asking what you get.
Garbage in, garbage out. In other words, you got (un?)lucky.
But if I change the condition in the while look to true so it keeps running, and remove the "= 0" from the fundamental type declarations I still get an issue.
Your program runs but it does not save previous input because you're reading into the same variables milesDriven (line 14), gallonsUsed (line16) every time and so any information saved within them from previous input is overwritten. To need some temp variables to manage the input informations
But if I change the condition in the while look to true so it keeps running, and remove the "= 0" from the fundamental type declarations I still get an issue.
Sorry if I seem slow, but just to clarify, by not setting the values to 0 when I try to use the += operative it doesn't work because I'm trying to add whatever value was inputted via cin with a garbage value?