Welcome to LQ.
Nice little "addition machine".
The code works fine on a couple of my systems.
( doesn't work without '#include <cstdlib>' ,
but '#include <stdlib.h>' instead works fine too.)
It's a good idea to tell, which Linux + "Linux version"
you are using, e.g Fedora 10, Ubuntu 8.10, RH EL 5,
every time a question is asked. ( And compiler version. )
Or add it to your Profile in "Edit Profile" here at LQ.