Answer:
This program is executed in C++ using dev C++, The explanation of the code is given below. However, the expected result of this program after running is attached
Step-by-step explanation:
#include <iostream>
#include <cmath>
#include<bits/stdc++.h>
using namespace std;
int main ()
{
double key=5;//it will generate next three keys from A;
double freq=440;//frequency ;
cout<<freq<<" ";//output the frequency
for(double i=2;i<key;i++)//loop to show next three frequency
{
float value = (1.0/12);// store value of (1/12)
double r=pow(2.0,value);//store value of r=2^(1/12);
double n=i;//number of ith iteration (number of next key)
double power=pow(r,n);//calculating r^n;
double result= freq* power;//function i.e. fn=f0*rn
cout<<result<<" ";//displaying result
}
}