I remember being very pleasantly surprised to learn this when I traveled there. Oddly, though it sounds exactly the same (to my ears) in all three languages, they each spell it differently:
Danish - tak
Norwegian - takk
Swedish - tack
But, happily, when you say it to somebody, you never have to worry about spelling, do you?