help

Write your question here.

You forgot to ask a question.
Also, on the side when writing your post, it says to please refrain from using the word "help" in your title
i need help with this assignment


1 Overview
Your task is to write a program that computes the log base b of a number n where the user provides both n and b. You will find the change of base formula
logb n = logc n, logc b
where c is any base, helpful when computing the logrithm. 2 Implementation Details
Your program will prompt for a positive number to find the logarithm of. Finally, your program will output the logarithm base b of the number n. The main function will be responsible for getting the input from the user, outputting your name and description of the program, and computing the resulting logarithm.
For this project you must use a function from the cmath library. Specifically, when you implement the change of base formula you will want to use either the log (loge) or log10 (log10) function.
Your output should look exactly like the example below. The example below is for a base of 2 and a number 32
1
Please enter the base (must be greater than 0): 2
Please enter a number (must be greater than 0): 32
The logarithm base 2 of 32 is 5.






my code:


/*
* File: main.cpp
* Author: Zac
*
* Created on September 22, 2015, 10:04 AM
*/

#include <cstdlib>
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;


int main() {
double base;
double num;


cout << "Please enter the base (must be greater than 0)" << endl;
cin >> base;
cout << "Please enter a number (must be greater than 0)" << endl;
cin >> num;
cout << logb(2)(32)=(logb(10))


return 0;
}
LB wrote:
You forgot to ask a question.
Topic archived. No new replies allowed.