• 2 days ago
Transcript
00:00Hello everyone this is sandeep today i am going to explain loop within loop in my previous
00:09videos i have explained if statement i have explained loop i have explained loop with
00:16if statement now i am going to explain loop within loop now to understand loop within
00:23loop how loop within loop works i will give a realistic approach example so the concept
00:30will be clear you will easily understand that how the loop within loop works ok so here
00:38i am going to give a example of a clock or you can say of a watch how the clock works
00:49how a watch works ok if you see in this example friends this is the example and if you see
00:56in this example this is hours hand and this one is minutes hand ok we all know that how
01:06clock works we will understand with the help of example that how the control from the hours
01:14hand come to minutes hand and once the control comes to minutes hand the minutes hand take
01:22the full rotation and again the control backs to what hours hand just keeping the procedure
01:29how the clock works in your mind we will be able to understand that how loop within loop
01:41also works ok so here in this example if you see the hours hand is showing three o'clock
01:47ok so at the at present the clock is showing three o'clock now once the time is three o'clock
01:54the control will reach to minutes hand and this one is the minutes hand this one is minutes hand
02:03so the minutes hand will take the full rotation of 60 minutes it will move one two three four
02:09it will take the full rotation of 60 minutes once it will complete the full rotation of 60 minutes
02:15again the control goes back to the hours hand ok and the time will change from three o'clock to
02:23what four so once it will change the time the control again goes back to minutes hand
02:33ok this minutes hand and again it going to take the full rotation from one two three four up to
02:4060 minutes so we can say that hours hand is outer loop and minutes hand which is taking the full
02:48rotation from one to 60 minutes it is the inner loop just keeping in mind the procedure of watch
02:57and a clock we can easily understand that how loop within loop works once the control from the
03:09hours hand comes inside the minutes hand it's not going to start from 60 then 61 62
03:18like that it will going to start from its initial value that is from one one two three and take the
03:24full rotation of 60 ok so always when from the hours hand the control comes to the minutes hand
03:33it is it is going to start from its initial value that is from one and it will take the full
03:38rotation of 60 minutes then the hours hand times changes as it's showing four and once the minutes
03:48hand take the full rotation of 60 minutes the time from four o'clock changes to what five
03:56so just keep in mind how the clock work how the watch work ok the same procedure the same method
04:03is applied in loop within loop in the next video i'm going to explain loop within loop in a flow
04:10chart so the things will be more clear with one of the example thanks for watching this video bye

Recommended