Hey, guys, what's up?
So in this video and this session today, we are going to solve industrial problems without problem.
Statement is given and we have to print all the numbers.
We have to print all numbers from one, two.
And so if you remember, we have all this all this question and flowcharts and pseudocode.
But today we are going to write its actual working code.
OK.
So the problem is very easy.
So use it will give us a number n and we have to print all the numbers from one to.
For example, add to the value of N history.
So my output should be one, two, three, similar to the value of.
And is six.
Some output should be one, two, three, four, five and six.
OK.
So this is the problem.
Now how we can solve it.
So the solution is very easy.
So what we will do.
We will run a loop and this loop will run and times and each time.
And this loop is running.
I will print a number.
OK.
Let's say the number is I.
So I will print a number.
I and I will increase its value.
So I will do I plus.
Plus.
So that next number get printed.
And so the next number get printed.
OK, so a court will look something like this.
So first of all, I have to run a loop and times so I equals one when I.
Less than articles to end.
And here I am having a placeless.
So with the help of these three.
This loop will run and times and each time this loop is running, I have to print a number.
And that number is I only.
OK.
So let's see how it works.
So I've already made a file.
Bring the numbers, dart, CPB.
Now, what I have to do, I will take a number and as input.
So, yes, they will give us the value of an.
And I have to run this loop and times so I equals one.
While I is less than articles to n sorry, Smolan.
And I plus, plus, plus, plus.
So this loop will run and times and each time this loop is running, I will.
Brent I.
So this is all that we have to do.
Simple.
So let's test our program.
Let's say the value of an is food.
So one, two, three, four is my output.
Let's say the value of and is dwil, so output is starting from one day to Shalva quarters.
Hundred percent, right.
Now let's see how it is working.
So what is happening here?
So suppose the value of an is three.
So we will test our program for nine equals three.
So I equals one initially and let's say, hey is my output output.
So I equals one.
I am writing here.
I question.
Now take the condition is one less ten articles.
Two, three.
Yes, the condition is true.
I will go inside the loop ceo I, I will print when I plus plus.
So the new Aliev I is to now check the condition.
I mean is to is to less than hourly.
Close to three.
Yes.
The condition is to print a one two and now increase the value.
If I buy was a new.
Well Lo Fi is three.
OK, so now you will check the condition again.
Is three less than Ahlquist three?
Yes, the condition is to see out eye.
So one, two, three, is my output non visible if I buy one.
So a new Aliev, I will become.
Forward.
Now check the condition.
So is four less than or close to three?
No, the condition is false.
You will come out of the loop.
You will reach at this line.
And this is my output.
One, two and three.
Which is hundred percent.
Correct.
OK.
So the thing that we have done is called Brian.
Brian in your program.
So what is the meaning of Brian?
Brian means what do you do?
You take you take a value.
You take input.
And you run your record manually.
You run your code manually on pen and paper.
With the help of pen and paper, you run your code manually and try to figure out how all these things
are working.
So this is called Diren.
Byron is very important.
For example, if you have written code and output is coming out to be wrong.
So what do you do?
You will take a value as input and you will run your code manually to see where the things went wrong.
Okay.
So what really we're doing?
We will be writing code and then we will drive in our program for certain and put.
OK, so this problem was very easy.
And next, we do we will solve that problem.
Thank you.