Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
Learn Programming Technique C to Master Skills - Loop Within Loop Program Explanation in Flow chart
Tutorials Arena
Follow
10/17/2024
Category
📚
Learning
Transcript
Display full video transcript
00:00
Hello everyone today I am going to explain lube within lube
00:05
In my last video I have explained lube within lube with the example of a realistic approach
00:13
I have given the realistic approach example to explain it
00:17
I have given the example of a watch
00:20
I have given the example of a clock
00:22
How the hours, minutes and hand work
00:26
How the time changes and the control comes to the minutes hand and the minutes hand take the full
00:31
rotation from 1 to 60 and again controls goes back to the hours hand and it and the time changes
00:39
and then again controls come back to the minutes hand
00:43
So the hours hand is working as a outer loop and the minutes hand is working as a
00:48
inner loop that I have explained in my last video
00:52
So just keep the procedures that the method in which the clock works in your mind
00:58
because the same methodology almost the same method of working of a clock
01:05
is applicable in lube within lube also
01:07
Okay so this is the program which I am going to explain of lube within lube
01:13
What I have to display I have to display this one on the first row
01:18
Then the second row I have to display one and two
01:21
So on the second row it's going to cover the second row first column
01:27
Then the second row second column and the third row I have to display one two three
01:32
So it's going to cover what third row first column third row second column third row third column
01:42
Okay so in this way I have to display first one
01:46
and then one two then what one two three
01:49
So here is a block diagram here's a flow chart of it
01:54
This one where I am rotating my mouse i equals to one and i less than equals to three
02:00
represents to the outer loop okay
02:03
and the inner one where j equals to one and j less than equals to i
02:07
this one represents to the inner loop okay
02:11
So the outer loop is for the rows and the inner loop is for columns okay
02:18
So let us do the dry run and understand how the things will work
02:22
The value of i is what one one less than three the condition is true
02:28
Just remember the values of i and j okay
02:32
What is the value of i it's one one less than three the condition is true
02:37
Immediately it will come inside the inner loop
02:40
What is the value of j it's one okay j less than equals to i
02:46
So what is the value of j it's one what is the value of i it's one
02:51
So one equal to one the condition is true so I am going to display the value of j okay
02:57
So I am going to display the value of j so what is the value of j it's one
03:01
So one is going to display okay
03:05
Now the value of j is going to change one plus one that is what two
03:11
Now the new value of j is what two okay now the inner loop will continue
03:17
The value of j is two two less than one as the value of i is one
03:24
Here the condition will get false okay here the condition will get false
03:28
It will come to the no part and it will come to the outer loop
03:32
And the outer loop the value of i is going to increment
03:36
What is the value of i it is one one is going to add with it
03:40
So what one plus one that is what two okay
03:45
Now the outer loop will work here it will go to the decision part
03:51
Two less than three yes two is less than three the condition is true
03:56
Immediately it will come to the inner loop
03:58
Now as I've explained the example of clock and watch that when from hours hand control
04:07
Comes to the minutes hand it's not going to start from 61 62 like that the minutes okay
04:13
But it's going to start from its initial value that is one one minute
04:17
And it will take the full rotation one two three four up to 60 minutes
04:22
Then the hours hand will change the time
04:25
The same procedure is applicable here once the control will come inside the inner loop
04:31
The j is going to start from its initial value that is one okay
04:36
So one less than equals to two this time value of i is what two yes one less than equals to two
04:43
The condition is true it will come to the yes part
04:46
What is the value of j it's one so one is going to print okay
04:51
Then one plus one now the value of j is going to change that is what two okay
04:58
Now the new value of j is what two inner loop will continue two equals to two
05:04
Yes as the value of i is two we have to remember the values of the variables
05:10
Value of j is two the value of i is two two equals to two the condition is true
05:15
It will come to the yes part now it's going to display j
05:19
And the value of j is what two so it's going to display what two okay
05:27
Now two plus one that is what three two plus one three now the new value of j is three
05:34
It will go here three less than two what will happen the condition will get false
05:40
It will come to the no part
05:42
To the outer loop the value of i is going to increment okay two plus one that is what three
05:51
Now the value of i is incremented okay two plus one that is what three
05:56
Now the new value of i is what three on the outer loop here three equals to three
06:03
The condition is true now it will come to the inner loop
06:07
The inner loop will start from its initial value that is j equals to one
06:12
Now j is what one and it's going to compare with three one less than three
06:18
Yes the condition is true the value of j is going to print that is what one
06:25
Okay then the value of j is going to increment one plus one that is what two
06:30
Okay now value of j is two okay two less than equals to what is the value of i it is
06:41
Three so two less than three the condition is true it will come to the yes part what
06:47
is the value of j this time it's two so two is going to print okay remember the values
06:53
Now the incrementation will take place two plus one what three now the value of j is what three
06:59
It will again go to this decision part three equal to three yes as the value of i is three
07:05
So three equals to three the condition is true it will come to the yes part
07:09
j is going to print so what is the value of j it's three so three is going to print okay
07:15
Now three plus one that is what four three plus one that is what four now the new value of j is
07:21
what four again it will come to the decision part four less than what is the value of i
07:27
It's three four less than three condition will get false it will come to the no part
07:32
Come here to the outer loop the value of i is going to increment from three it's going to
07:38
add with one three plus one that is what four now the new value of i is what four okay it will come
07:44
to the decision part four less than three four less than three the condition get false it will
07:51
come to the no part and then stop but as the program says to display one then one two one
07:57
two three we got the result okay so please watch this flowchart again and again to understand the
08:05
concept I hope you must have understand it in the next video I'm going to make the program
08:13
in C okay thanks for watching
Recommended
4:57
|
Up next
Learn Programming Technique C to Master Skills - Loop With If Statement Program ( Flow Chart )
Tutorials Arena
10/13/2024
8:01
Learn Programming Technique C to Master Skills - Loop Within Loop Program
Tutorials Arena
10/17/2024
3:27
Learn Programming Technique C to Master Skills - Third Program of Loop ( Flow Chart)
Tutorials Arena
10/17/2024
3:52
Learn Programming Technique C to Master Skills - Second Program of Loop (Flow Chart)
Tutorials Arena
10/17/2024
4:01
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( Flow Chart )
Tutorials Arena
10/13/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (Flowchart)
Tutorials Arena
10/13/2024
10:56
Learn Programming Technique C to Master Skills - Loop With If Statement Program
Tutorials Arena
10/13/2024
2:11
Learn Programming Technique C to Master Skills - Explanation of Second Program in Flowchart
Tutorials Arena
10/8/2024
4:19
Learn Programming Technique C to Master Skills - Loop Within Loop Explanation with Real Time Example
Tutorials Arena
10/17/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (For Loop)
Tutorials Arena
10/13/2024
4:03
Learn Programming Technique C to Master Skills - Second Program of Loop ( For Loop )
Tutorials Arena
10/17/2024
3:55
Learn Programming Technique C to Master Skills - First Program of Loop (While Loop)
Tutorials Arena
10/13/2024
4:07
Learn Programming Technique C to Master Skills - Second Program of Loop (While Loop)
Tutorials Arena
10/17/2024
2:41
Learn Programming Technique C to Master Skills - Explanation of First Program of C Language in Flowchart
Tutorials Arena
10/8/2024
4:28
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( For Loop )
Tutorials Arena
10/13/2024
8:07
Learn Programming Technique C to Master Skills - Loop with if Statement Second Program
Tutorials Arena
10/17/2024
2:58
Learn Programming Technique C to Master Skills - Nested If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
5:02
Learn Programming Technique C to Master Skills - Third Program of Loop
Tutorials Arena
10/17/2024
5:33
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( While Loop )
Tutorials Arena
10/13/2024
4:54
Learn Programming Technique C to Master Skills - Single If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
5:29
Learn Programming Technique C to Master Skills - Continuous If Program (Flow Chart)
Tutorials Arena
10/8/2024
12:06
Learn Programming Technique C to Master Skills - Continuous If Statement Program
Tutorials Arena
10/8/2024
5:14
Learn Programming Technique C to Master Skills - Single If Statement Program Explanation
Tutorials Arena
10/12/2024
12:22
Learn Programming Technique C to Master Skills - Bubble Sort Program
Tutorials Arena
10/20/2024
4:57
Learn Programming Technique C to Master Skills - Loop with If Statement Second Program Continue...
Tutorials Arena
10/17/2024