I have Google Analytics for one of my sites, can I use the same code for my three sub-domains as well or do I need different codes for all 3 sub-domains.
you can use the same code, but if they are separate sites (which i assume they could be if on subdomains) it can be handy to separate them.
if you want to track the subdomains from one site then only one code installation in homepage is enough.