OK, so let us soil.
Problem number two.
So the problem, this treatment is we have to find largest of any numbers.
Largest off any numbers.
We have already covered a simple version of this problem.
The problem was you have to find the largest of 10 numbers.
So the flow chart was something like this.
You start you read 10 numbers, A, B and C, and then you check is eager, then B and is eager.
Then C, in that case, you will print it.
And Andy, a program, if this is not true, you will check for B is bigger than A and is bigger than
C.
If this condition is true, you will print B and then you will end your program.
Similarly, if it is not the largest number, B is not the largest number.
So that automatically means sees the largest number.
So you will Pennsy and then you will end up little.
We have already covered the discussion.
So what is the difference between this problem and this problem?
So the defense is obvious here.
I know that there are only two numbers here.
I don't know how many numbers.
So if I know that they're only two numbers, I will get three variables, a BNC.
But in this case, I don't know how many variables do I have to make because I don't know the value
of.
And as the value often will be given by user.
So the first problem is how do I read in numbers?
What will I do?
I will run a loop and times.
I will run a loop and times with the help of these three blogs.
I equals one.
I iList and I was too in.
I was a plus one.
So with the help of these three blogs, I will be able to run a loop and times.
OK.
Each time this loop is running, I will do that number.
Give you the number.
So in total, I will be able to read in numbers.
So the first part of our problem is or what?
That is how we can read and numbers.
So with the help of a loop, we can read in numbers.
Now, the second part I had to find largest of all these numbers.
So this part is a little bit tricky.
So what will I do?
I will use a variable largest.
Initially, my largest will be minus infinity.
Then I will try to maximize it.
What will I do?
You're kidding.
No.
OK.
Compare this number with the largest.
If the number that you have read is greater than the largest.
Then upgrade the value of largest, largest is equal to no otherwise.
Do not think.
Simple to vent, this loop will terminate my variable largest.
We'll be storing the largest of all this in numbers and then I will bring to my largest.
OK, so let us draw the floor.
Jack.
So I will start my flow chart.
Then I will read an.
Then I will take I will use two variable.
Initially I was one and largest equals minus infinity.
Then I will try to maximize largest.
So for running the loop and time.
What will I do?
Is a list and it goes to doing.
And similarly, I will be having here.
I will say blessin.
So with the help of these three blogs, I equals when I listen was when I was a policeman, my loop
will end times.
So if this condition is true, yes, I.
Is less than articles to end.
I really do.
No.
In the loop.
I have to read a number.
Now, you have to compare this number with the largest.
So if then the murder to have read is greater, then largest.
That means I have to update my now just so if this condition is true, yes, then a mother to have it
is good.
Then largest, then update largest.
So largest as it goes to them.
Now my largest number, is it close to the number there to have had.
And then.
You have Dorinda, The Luban Times.
Okay, so what if this condition is false?
If this condition is false?
There is no need to do anything.
No.
And then you will simply run this loop and times and vendors loop will break.
When this condition will be false.
I will bring largest because logistics storing the largest of all this and numbers.
After printing, I just I will end my program.
OK, so let US Airways.
What do you have done?
We will try to understand this flowchart with the help of an example, let's say, and equals three.
And that training must be three, two and five.
So and it goes three.
And the numbers are three, 25.
So my largest is equals to five.
OK.
So let us run this flowchart.
Start a read and and it in three.
Initially I equals one.
I equals one and largest as it goes to minus infinity.
OK.
So you will come here.
Is one less done.
It goes to three.
So the condition is true.
You will come here.
OK.
Rule number.
Is three good?
The largest is three, then minus infinity.
Yes, three is obviously good.
Then minus infinity.
So you will come here.
You have to update the relief of largest, so largest.
Is it close to the number that you have ordered?
So largest?
Is it close to three?
And then you will include when they really if I buy one.
So the new value of AI is to.
You will check the condition again, is through less than a ghost territory.
Yes, the condition is true.
You will come here every day.
No.
Is too great.
Then largest, largest as equals two, three.
So is to a good entry.
No.
You will come here.
And given the way I live, if I buy one so there's no change in the value of largest largesse just to
year and given I really if I buy one so the new value of AI is three.
And then you will come here is three less.
Then it goes to three.
So the condition is true.
You will come here.
Rule number five.
You will come here is five good, then three.
Yes.
Five is obviously good.
Then three.
So you will come here and you will appreciate the relief.
Largest.
So largest.
Is it close to five?
And then you've come here.
Incrementally, if I wear one, so the new vilify is four.
And then you will come here is for less than articles two three.
No.
False.
So we'll print largest.
You will print five.
And then you will endure program.
So I am printing five.
So my flowchart is hundred percent correct.
So let us revise what we have done.
So the problem was we have to find the largest of any numbers and we have all this oil, a simple version
of this problem.
The simple question was, do we have to find the largest of three numbers since we know that there are
only three numbers?
So I use only three variables.
But in this case, I don't really often.
So I don't know how many variables do I have to make?
So the first problem is how to read and numbers.
So we will run the low end times and each time I will read a number.
So the first problem is over.
I will be able to read and numbers and how this loop will end and times with the help of these three
blogs.
I will be able to run my loop end times.
And the second problem is I have to find largest of all this and numbers.
So what will I do?
I will use a variable largest, initially my variable largest as it goes to minus Infinity.
After reading the number, I will compare that number with the largest.
If the number that we have read is a good then largest.
Then I will update the value of largest.
So largest close to lump.
Otherwise do nothing.
So let's see the flow chart.
Let's see any equals three.
OK, let's see.
And it goes to five and seven.
OK.
So you start then.
Initially I was one.
Largest it was minus infinity.
Then you will come here is one less than it was doing for the condition is true.
You will come here.
Read them.
But I will read five.
So it is five for the largest.
Largest as it was two minus infinity.
So is five greater than a minus infinity.
Yes, the condition is true.
You will come here.
Largest English name, we have doubled the value of largest, so largest.
Is it close to five?
And then you willingly wonder really if I buy one?
So then you little fi is two.
And then you will check again is to list than was to do so.
The condition is true.
You will come here again to them.
But this time we will read.
Seven is seven.
Good then five.
Yes.
Seven is good.
Then five for the condition is true.
You will come here.
You will upgrade the value of largest.
So largest.
It was seven and then you will go in there earlier if I buy one.
So I equals three if you will check the condition.
This Gamla condition becomes false because three is not less than it was.
Two, two.
So the condition is false.
You will come here.
You will print largest.
So seven liberated.
And our output is under eight percent.
Correct.
Because out of five and seven, seven is the largest number.
The trickiest part in this equation is.
This part.
Largest equals minus infinity.
So remember this.
What will you do?
You will initially assume that my largest number is the smallest number.
And then you will try to maximize your largest number.
OK.
So if you want to find the smallest number of this end numbers, what will you do?
You will use a variable smallest and you will initialize it to plus infinity.
So this is tricky part.
So I'm repeating myself.
If you want to find out the smallest of this end numbers, what will you do?
You will use a variable small list and you will initialize smallest to plus infinity.
Here you will check is numb, is then a mother to read is less and smallest.
If this condition is true, you will abrade smallest number, smallest equals numb, otherwise do nothing.
OK, so now we will be solving large problem of part two, problem number three.