Question

Using C++ code, write a program named q5.cpp to solve the equation 2n = 14.27 for...

Using C++ code, write a program named q5.cpp to solve the equation 2n = 14.27 for n.

Homework Answers

Answer #1

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;

}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Explain your code with comments. Solve in C++. Write a function named myFunc3() that takes a...
Explain your code with comments. Solve in C++. Write a function named myFunc3() that takes a 2D integer array NUMBERS[][50], and it size n and m. Then the function will print the sum of each row in one line.
Code using C# Write a program that outputs “Welcome” five times
Code using C# Write a program that outputs “Welcome” five times
Write a program which can be used to solve any system of equation using the Scaled...
Write a program which can be used to solve any system of equation using the Scaled Pivoting GE method
C# Programming Write, compile, and test a program named Lyrics that displays at least four lines...
C# Programming Write, compile, and test a program named Lyrics that displays at least four lines of your favorite song. Code Patterns to follow are the following (All these have to check out: -Checks for correct use of WriteLine (4x) Description Searched your code for a specific pattern: (\s*WriteLine\(".*"\);\s*){4,} Start code with this outline: using static System.Console; class Lyrics {    static void Main()    {     // Write your main here    } }
C++ If necessary, create a new project named Introductory20 Project and save it in the Cpp8\Chap13...
C++ If necessary, create a new project named Introductory20 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Introductory20.cpp. Write a program that displays the appropriate shipping charge based on the region code entered by the user. To be valid, the region code must contain exactly three characters: a letter (either A or B) followed by two numbers. The shipping charge for region A is $25. The shipping charge for region B is $30....
IN C++ Write a program named printStringReverse.cpp to read in a C-Style sting. Print the string...
IN C++ Write a program named printStringReverse.cpp to read in a C-Style sting. Print the string forward and then backward using pointer increment and decrement. Declare the C-Style string as following: char s[50]; Read the string as follows; cin >> s; Write the following code to get the actual number of characters from your string. int count=0; while (s[count] != NULL) { count++; } count contains the actual length of your string since we declared the array to hold a...
Can you solve this C program by using Function? Q1. Write a C program to ring...
Can you solve this C program by using Function? Q1. Write a C program to ring the computer bell at any number of times you specify. Use the system clock as a delay, you need to include the time header file.
C program- using visual studio code. Write a program that asks for an integer and then...
C program- using visual studio code. Write a program that asks for an integer and then prints all the alternative integers from (and including) that value up to (and including) a value larger by 20. (That is, if the input is 5, the output runs from 5 to 25.) Be sure to separate each output value by a space or tab
Run Using Kali Linux....Create a source code file named "Lab1.c". The code is as follows. A...
Run Using Kali Linux....Create a source code file named "Lab1.c". The code is as follows. A child is created and prints a message five times. The original process (parent) prints a message only three times. How would this code look on the compiler if you could please post the code and the compiler results. Need Reference Thank You #include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main() { pid_t pid; char *message; int n; printf("fork program starting\n"); pid =...
Write in C++ program and write a function named add. It should accept two const double...
Write in C++ program and write a function named add. It should accept two const double type references as arguments. The first argument should be named num1; the second argument should be named num2. The function should return by value of num1 plus num2.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT