00:01
Welcome to this lesson.
00:01
In this lesson we use java to print this pattern.
00:09
So we'll have 54, 3, 2, 1, then 5 4, 3, 2 in there.
00:20
So here we'll use 2 4 loops, 1 that prints each line.
00:25
Okay, so we consider 5, 4, 3, 2 1 to be one line, then 5, 4, 3, 2 to be another line, then we have another loop that also print the 5, 5, 4, 3, 2 1 to be one line, then we have another loop that also print the 5, 5 ,000, 5 4, 3, 2, 1, print that they get on the line, right? so let's go on.
00:44
Let's have 4 loop, i think, that is equals 2.
00:50
Starting from 1, 5, less than, less than equals to 5, then i++.
00:59
Okay, now we can have an inner look that would be used for the for then let's have this in the main method so public such a main so that the nafone would have in j that is equal to five so they all start from stuff from five then it keeps reducing so we have j that's called to five a that is less than or equal to i then a minus minus so we have a fall loop other the outer fall loop which keeps increasing from one to five representing the number of lines that we have we also have a onion a four loop which keeps reducing that is from five to one okay so simply print suspend out it you will not prank onto a new line to print onto the same line but when we come to when we exit the inner follow it will simply be to this new line so that we'll jump to the new line and we'll jump to the new line and we'll start printing again all right so this is all that we need let's run and see our results here is no ending let's quit that something okay they actually this should be it should be greater than or equal to i all right so that we get to a point where i is when i is called to five that is after you have completed the last five that the first five times it will not go again else the loop will not be hesitated so let's again, it's compiling, okay...