Another way to say "dancing is for getting exercise" is "Exercise can be a consequence of dancing."