How to make a frequency generator?

Is there a way to generate a sound frequency in c++?

Like type in a number and it plays the frequency (a.k.a 40 hertz)
Topic archived. No new replies allowed.