Hello, I am trying to create a tone, then another tone using this code. It currently only plays one of them. Is there something missing or am i going about this wrong?

```
for(int n = 0; n < num_samples; n++) //where n is the step |start of for loop
{
int fr = 523; //Frequency A
data[n] = amp*sin(2*pi*fr*n/fs);
cout << n << "\t" << data <<"\n";
} // | end of for loop
for(int n = 0; n < num_samples; n++) //where n is the step |start of for loop
{
int fre = 587; //Frequency B
data[n] = amp*sin(2*pi*fre*n/fs);
cout << n << "\t" << data <<"\n";
} // | end of for loop
write_wav_file(data, num_samples, fs, fp);
```