Using C++ code, write a program named q5.cpp to solve the equation 2n = 14.27 for n.
Screenshot:
Code:
#include <bits/stdc++.h>
using namespace std;
int main()
{
//2n=14.27
//n=14.27/2
float n;
n=14.27/2;
cout<<n;
return 0;
}
//if 2^n=14.27 then find n
#include <bits/stdc++.h>
using namespace std;
int main() {
//2^n=14.27
//n=log2(14.27)
float n;
n=log2(14.27);
cout<<n;
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.