So let us continue on our understanding of recursion.
Now in this video, I want to give you a question which you are going to first try yourself, or all
the things which I have taught to you as of up till now.
And in the next video, I'm going to solve this question for you.
So the question is write a program to find sum of all natural numbers up to a given number n, but you
have to do this question recursively okay.
So I will be giving I will be giving you n number.
So let's say if n is five then you have to tell me what is going to be the answer of one plus two plus
three plus four plus till five.
Like till five.
What is the answer of all the natural numbers?
Okay, you have to also state the recurrence relation and draw the recursion tree.
Now I know that recursion tree is something which you have not taught you as of now.
So you can leave this.
I'm going to show you in the next question.
Uh, this recursion tree is actually something which is asked, uh, like in many interviews, and you
should have an idea on that.
So that's why I'm going to teach you how to exactly draw recursion tree.
And that helps you to even, I would say, do the question nicely.
And also something we are going to study in future about complexity.
So that is helpful in that normally uh the recursion tree.
So we will learn about that should be fine.
But as of now you have to make sure that you write this code and you are able to write this recurrence
relation as well.
Okay.
So this is how our uh, overall I would say the definition of our code and function would look like
definition of our function sum of numbers till n.
And we have to print this sum of numbers.
Let's take a five and maybe we can take till ten and everything okay.
So yeah just try this question once everyone and I hope you are able to do it in the next video.
In the next video I'm going to make sure that I explain to you properly.
And I also tell you how you can draw the recursion tree.
Okay, cool then.
Thanks a lot everyone.
Let's meet in the next video.
Thank you.