I am a complete newbie in C++ programming. After a very basic introductory class I am now reading a little more advanced book and trying to teach myself and I am slowly learning. Anyway, the book mentions a method for calculating the cube root of a number but it doesn't give any actual examples. It left me a little confused. Is there a website that any of you are familiar with where it shows the code for this and other basic programs for me to quickly refer to when I get stuck on a particular problem? I googled "cube root calculator" but it didn't return much. I don't want to continue reading forward until I get the hang of this problem.
mdbrock7
0
Newbie Poster
Recommended Answers
Jump to PostIIRC:
pow ( abs ( val ), 1.0 / 3.0 )
Jump to Post>it would greatly help me to see the entire program from start to finish
#include <cstdlib> #include <cmath> #include <iostream> int main() { int val; std::cout<<"Enter a number: "; if ( std::cin>> val ) { std::cout<<"Cube root of "<< val <<": " << std::pow ( std::abs ( …
Jump to Post>That one is more advanced than I am
Aroo? And then you post a manual attempt at it? :eek:>while (x - (a)(a)(a)) < 0.001)
(a)(a)(a) likely doesn't do what you think it does. ;) Perhaps you were trying to do:while (x - (a * …
All 13 Replies
Narue
5,707
Bad Cop
Team Colleague
mdbrock7
0
Newbie Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Narue
5,707
Bad Cop
Team Colleague
mdbrock7
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
mdbrock7
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
mdbrock7
0
Newbie Poster
mdbrock7
0
Newbie Poster
mdbrock7
0
Newbie Poster
mdbrock7
0
Newbie Poster
mdbrock7
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.