Neither 'end' or 'beginning' is initialsed the first time round so therefore 'tripdistance' is not initialised. Just put the calculations after the scanf. Also as a safety, set all your doubles to zero.
Your code does not compile. :/ #define rate 0.35 //Interferes with your declaration of rate in main.
end and beginning don't have any meaningful value when you're figuring out the value of tripdistance. Probably it would be a good idea to move that to after the first scanf. :)
Also your first printf is in a weird place considering what it's supposed to be indicating...
Why two scanfs? What's the purpose of the second one?