<p>I have a string like "1234567890". Now I need to store/print out this with the following format,
                     123-456-7890</p>

<p>What is the best method to implement this in C?</p>

<p>Thanks for comments/answers.</p>

There will be two schools of thought on this as far as what is "best".
One school says that, as long as it's functional and secure, whatever method uses the fewest resources (memory and processor cycles) is "best".
One school says that, as long as it's functional and secure, whatever method is easiest to read and maintain (though it may be inefficient) is "best".
Edit:
Redacted my answer as I don't like giving code answers to homework questions
As other answers and comments have suggested, you'll do best if you read the documentation for string.h and printf / sprintf.