At Techdirt there are a few articles that deal with this question but in general, it depends... (More, more, more and more...)
What is most important is when you had the chance to see the license. If you buy the software electronically and they display a license to you before they sell it to you, then the license can be enforced. And no, you don't have to accept that license since you will accept it by continuing the purchase. (Still, it gives the seller an additional protection.)
But most software will display a license after you've purchased the product. In that case, you are free to resell it to anyone you like, since you never agreed to this license to begin with. If you pay for something first, then have to accept the license then you're free to ignore that license. (However, most applications will only install after displaying the license, which you have to accept to continue to install it. This license could still be enforced! Why? Because you accepted it.)
However, if you do sell your software, you will have to uninstall it first from your own systems! You will also have to sell them including all the licenses and additional papers that were in the box, if you still have that box! And if you registered the software, you must turn over the registration information over to the new owner or unregister yourself so the new owner can register the software.
And sometimes you have to be aware that some companies will try to stop the resale of their products with tough, legal measures. While you have a good chance of winning those cases, they will be expensive and a waste of your time. Even though you might get all your legal expenses paid back after a long time, you will need to be handle those costs for quite some time.
And as others have said before, it does depend on your country, although almost every country has a right of resale like the USA. (Especially if software is delivered on CD-ROM or other hardware medium.)