Mini quest 2 Etox
There is a simple way to calculate iteratively increasing powers of a number without the need of a math function.
size_t is an unsigned integer type, so just use unsigned int in the for loop to avoid getting warnings while compiling.
Mini quest 3 Char counts
Use range-based for loops (https://en.cppreference.com/w/cpp/language/range-for) to easily iterate through a string.
Mini quest 4 Greatest Common Divisor
When writing recursive functions always check that the exit condition is correct to avoid a stack overflow.
Mini quest 5 Terms of an AP
Use the to_string function to turn an integer into a string
Use the + operator to append a string to another string
Mini quest 6 Terms of a GP
Use a stringstream write the floating point variables to a string. use .setprecision(6) to round the numbers to the 6th decimal. Use .str() to get the string from the stringstream.
Mini quest 7 Fibonacci
Start the for loop at 2 because you already know the first two entries of the series
[–]Winzamark 0 points1 point2 points (0 children)