Im currently doing a project whereby I have to create a pogram which has tone generation. I need help answering the following questions

1. Generating a beep sound on the buzzer / speaker
2. Generating a tone of certain frequency (using C program statements)
3. Generating a tone of certain frequency continuously for a certain duration (using C program statements)
4. Generating different frequency tones (using C program statements)

It will be greatly appreciated if you can post me the C Program for the Tone Generation.

Sorry if this post has been repeated twice.