Hey, guys, what's up?
So in the last class, I introduced you to Eddie.
Now in this class was all one problem on Eddie.
So the problem is very easy.
We have to some we have to find the somewhat ed elements.
We have to find the sum of ed elements, for example.
This is my Eddie and the values are three, four and five.
So my answer should be three plus four plus five, which is doing OK.
So we have to find the sum of Eddie Element.
So the problem is very easy.
So what do we do?
First of all, we will take input.
So how to take input?
First, I will ask the user how many number of elements.
So, say, in how many number of elements are there in the area.
So seen.
And then what I will do.
I will make an eddy of size.
And to store and values.
And now they will take and will loose as input.
So I equals zero.
I list an end.
I plus plus see in a off I now with the help of this I will be able to pick and values as input.
OK, so what it will do.
It will make an array of size and first index is zero and last indexes and minus one.
And this and this variable I is ideating from position number zero daily position number and minus one.
And each time it is filling the values we are taking input from the user and will fill the value.
Now we have to find some.
So we are finding some way to do.
Now we have our area ready.
For example, the elements are two for one and two.
So what do we do?
We will again, a trade or whether, Eddy.
And when we are doing attrition or dairy, we will add the values.
We will.
We would we do Luby.
We take a very well some some will initially be zero.
We will add some equals, some plus a fight.
So we will add a three here.
Then we will end four.
Then we will add one.
Then we will add two.
And finally, when this loop will dominate, I will see out some.
So that is all that we have to do.
So let's write the code.
So that doesn't name this filer's LSM or let's call it some of very.
Some of.
Eddie, not CBB.
Now, what we have to do, first of all, I would actually use the word.
How many number of elements are there?
So enter the number of elements.
Now, there does make a variable in artistic input.
So there are any number of elements.
Now there does make an eddy of size N.
Now what do we do?
We will take input.
So let us take input.
So Ford and I equals zero.
I list them and I bless bless.
I will take input, so now at this point of time, my error is ready.
Now I have to just find some.
So initially I will take a variable sum, which will initially be zero on the rise.
It will contain garbage value and allows it will be done.
Now, what I will do, I will.
I did order at it again.
So forward I do it again over the erry.
And what we have to do, we have to add the current value to Lessem.
So seven plus equals to pay off.
Now, that is all that we have to do.
Finally, we will spend some.
OK, so this is all that we have to do to find did some of the elements.
So they're distressed out.
I'm.
So ended the number of elements led to a number of elements of tree and the elements are one, two,
three.
So my son is six.
And these are Eddie elements.
OK.
OK, so let us do one more thing before finding this, um, let us spend the value of any let us spend
at elements.
So Folate and I it was his idol.
I asked him and I bless bless you out, ÁLFHEIÐUR.
So we are printing ed elements before finding this.
OK.
So this is for printing.
Now, let us stop around.
So let's say the number of elements out of five and the elements are one, two, three, four and five.
OK, so this is printing.
We are printing here.
You can see.
So this is printing.
And this is the sum of the added one plus two.
Blistery blissful plus five.
OK.
So the logic is very simple.
So if you have any doubt, feel free to ask.
Thank you.