Spawning of n threads to print numbers