Anonymous
k
Serenity
I couldn't find a solution to my recursive problem.
Serenity
Can anyone help me with that ?
Serenity
Yes I have written a code.
Serenity
I'll share it with you, just tell me if I am in the right direction.
Serenity
Taylor Rose
hello everyone ... need help with cryptography,advise the book, namely in the 'encryption hierarchy'?
Francisco
I'm missing information, why don't you send the full funcion?
Serenity
The desired outcome should roughly converge to 1.75..
Serenity
Just a second I'll upload the entire task
Taylor Rose
Serenity
This is what I am asked to do.
Serenity
And N is an integer provided by the user.
Serenity
so it's a finite sum and there is no need to be concerned about memory stuff and all that...
Serenity
Okay.
Serenity
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
// NOTE: Since <math.h> is included, you can use sqrt() to calculate the square-root of a number.
double repetitiveroot(int n)
{
if (n == 1)
return 1;
return sqrt(n) + sqrt(repetitiveroot(n-1));// the recursive call
}
// HERE: DEFINE THE RECURSIVE FUNCTION THAT CALCULATES THE VALUE OF THE EXPRESSION GIVEN IN THE HW
int main() {
int n;
double res;
printf("Please enter a number:\n");
scanf("%d", &n);
if (n < 0)
return 0;
res = repetitiveroot(n); // recursive function call
printf("Result = %lf", res);
return 0;
}
Anonymous
just writing this on paper as a mathematical function should tell you that you are wrong. this is why i asked you to read some lecture pdfs on recursion instead of giving you a solution in code.
Serenity
I am new to recursion and this type of questions is quite heavy on me
Serenity
So I need to some sort of boost and practical guidance in order to deal with recursion
Anonymous
Francisco
That means, the base case is n and not 1
Phafudi
How do I import C++ Boost libraries into Dev C++
Dima
simply, don’t use dev c++
Phafudi
Lol..What are the alternatives Dima
Anonymous
Phafudi
Thanks Ashish ;)
Phafudi
Cool...I lean more towards freeware
Anonymous
Phafudi
Some of those aren't free 😑
Anonymous
Visual Studio is free for personal use
Qt Creator is free
CLion is free for students
Dima
dev c++ can be free but it’s retarded
Dima
and not really much used in production
Phafudi
Anonymous
okay
Anonymous
hy rose
Dima
lol
Quinn R
Hello friends,
I have a few questions..
Quinn R
Is it necessary to learn C in order to learn C++?
Quinn R
Quinn R
I mean can you explain it further?
Deleted Account
Needs means?
If u have a job that needs you to use or work with c+ first you can start by learning it
Deleted Account
If you master c ++ u can easily understand object c and learn swift and start writing ios apps
Quinn R
No i don't have a job that requires me to learn C or C++. I am learning it for my own purpose
Nils
Hi, is there some way to check if a binarys source is C++?
Anonymous
Can any one suggest me that from where i study dynamic programming...
Dima
Anonymous
I want to study dynamic programming
Anonymous
DP
Nils
Nils
Sorry, but I can't paste this in here
Nils
less simply displays is better than Telegram
Nils
And yes that is the entire program
Anonymous
Quinn R
Dima
lmao
Anonymous
Quinn R
@unterumarmung can you suggest what should i start learning first? C or C++?
Anonymous
Quinn R
Dima
Anonymous
noob*
It was on purpose, noooob
Quinn R
And also if i learn C++ will i need to learn C later on?
Anonymous
Anonymous
It'll tight together
Anonymous
And it depends on how you learn
Nikk
Chaman
Anonymous
Dima
what