00:01
Hello everyone we are going to understand this question here given in the question there is two parts in one question here in part one there is a two number which is entered by the user that is a and b and we have to find the series some of this particular series here in this term we have to see we can see that first term is a and it will continue till end term or last term that is not b.
00:32
So we have to increment in a by 1 and we have to add in the previous term and we have to find the sum of this series and in part v we have to find the it includes four terms a, b, m and n.
00:49
Here n is greatest and means n is greater than m and m is greater than b and b is greater than a and we have to find the sum of this series.
01:00
So we will see firstly part one how we will solve here in part a we can see here has include studio .h we have defined a function that is sum underscore interval there is two parameters a and b so first of all we will see from the main function here main function will start to execute we have defined a and b because we are going to scan this value by the user.
01:38
Enter the value of a, scan of percentage d, ampers and a.
01:46
So it will scan the value of a and second term, we will enter the second term and this will call some interval ab.
02:01
Means this will call the defined function that is sum underscore interval only if b is greater than a then only it will call else it will say or say that the entered value or you have entered in correct range a and b must be integer and b must be greater than a so this is the condition for calling this sum underscore interval so we will end enter the value of a and b, then it will recall this function.
02:39
Sum underscore interval, inta, int b.
02:44
It will pass the value and here we have defined a term sum and add.
02:50
Now the series for the given terms.
02:53
So firstly it will print the series which we have seen in the given question.
03:03
Now after printing a series it will print the sum of the series.
03:10
So here we can see the execution of the program.
03:13
Here we have applied for loop.
03:15
So initially it starts from 0 until b.
03:19
So initially we defined value of sum 0.
03:24
So here value of a which is passing in this main function and then it will come into this some underscore interval.
03:36
So here suppose we are giving it 2 .5.
03:40
Here some interval suppose we are giving here 2 .5 then 2 plus 0 so first term will be 2.
03:52
2.
03:52
2.
03:53
2 will be 2 plus 1 that is 3 so second term will be 3 and third term 3 plus 1 means here now this value is 3 plus 1 that is 4 again we will print it will print 4 then 4 plus 1 it will print 5 as so on now this function this program means here follow we have to add the value of the given series so initially sum of series that is sum is 0 so a plus 0 means 2 plus 0 2 2 then after 1 time execution it will add 2 plus 1 3 means 3 plus 2 5 so next will be 5 and if we will mean after in the third execution it will 5 plus 3 8 and as so on it will execute now let's run this program here let value of a is 2 and value of b is 10 then, sorry, it's a different one, we have to run this program.
05:19
So here, now we will execute this program...