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 - First Program of Loop (Flowchart)
Tutorials Arena
Follow
10/13/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hello everyone, this is Sandeep. Today I'm going to start loop.
00:07
In loop the set of statement carries on till the condition is true and when the
00:15
condition become false the loop terminate.
00:21
Loop means iteration or repetition. So we apply the condition in such a way
00:28
that we will get more than one results and when the condition get false the
00:34
loop terminate.
00:38
When the condition is true then the set of activities will carry on and when the
00:45
condition is false and the loop terminate. So we can understand how the
00:50
loop works with the help of this simple program that is display first three odd
00:55
numbers as I have to display first three odd numbers 1, 3 and then 5.
01:02
So let us understand it. First of all I have taken two variables one for the
01:07
odd number that is od, I have taken i to count the odd number. So od I
01:14
initialize the value of od that is 1 and this is the first odd number for
01:19
the counting of it I have taken a counter variable i equals to 1.
01:24
So here it will come 1 less than 3 as I have to display only the first three odd
01:30
numbers 1, 2, 3. The loop is going to work for the three times that's why in a
01:35
decision box I have written i less than equal to 3. Let us do a dry run what is
01:41
value inside i it's 1, 1 less than 3 the condition is true it's going to come
01:47
to the yes part and it's going to print what odd. What is inside of od it is 1
01:54
so it's going to display what 1. Then I need what 3 so what I will do I
02:01
will write a question in such a way od equal to od plus 2. So what inside
02:07
od it is 1, 2 is added to it 1 plus 2 now inside od it is what 3. So please
02:15
remember the values of the variables okay inside od it is what 3. Now it will
02:21
come to the next equation that is i equal to i plus 1. What is inside i it is
02:27
1, 1 is going to add with it so 1 plus 1. Now the new value inside i it is 2.
02:35
The loop will carry on 2 less than 3 because now inside i it is 2. So 2 less
02:42
than 3 yes the condition is true it will come to the yes part. What is inside od
02:47
it is 3 so what it is going to print 3. Then what 3 plus 2 inside od it's 3, 3
02:56
plus 2 that is what 5 and here the equation 2 plus 1 that is what 3. So
03:02
inside i it's 3. Again the loop will carry on 3 equal to 3 yes the condition
03:08
is true it will come to the yes part. What is inside od it is 5 that's going
03:13
to print what 5 okay and 5 plus 2 7 and 3 plus 1 4. Now inside i it's 4 inside
03:23
od it's 7. It will come here okay here 4 less than 3 the condition falls it will
03:33
come to the no part and then would stop. So we get 1 3 and 5. I hope you
03:41
understand how the loop work. I'm going to implement the same program in C in my
03:47
next video. Thanks
Recommended
3:52
|
Up next
Learn Programming Technique C to Master Skills - Second Program of Loop (Flow Chart)
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:51
Learn Programming Technique C to Master Skills - First Program of Loop (For Loop)
Tutorials Arena
10/13/2024
4:57
Learn Programming Technique C to Master Skills - Loop With If Statement Program ( Flow Chart )
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
4:01
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( Flow Chart )
Tutorials Arena
10/13/2024
3:55
Learn Programming Technique C to Master Skills - First Program of Loop (While Loop)
Tutorials Arena
10/13/2024
5:29
Learn Programming Technique C to Master Skills - Continuous If Program (Flow Chart)
Tutorials Arena
10/8/2024
4:55
Learn Programming Technique C to Master SkillsCharacter String Second Program (Flowchart)
Tutorials Arena
11/19/2024
2:58
Learn Programming Technique C to Master Skills - Nested If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
4:03
Learn Programming Technique C to Master Skills - Second Program of Loop ( For Loop )
Tutorials Arena
10/17/2024
8:06
Learn Programming Technique C to Master Skills - Linked List ( First Program)
Tutorials Arena
11/30/2024
8:01
Learn Programming Technique C to Master Skills - Loop Within Loop Program
Tutorials Arena
10/17/2024
4:28
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( For Loop )
Tutorials Arena
10/13/2024
3:20
Learn Programming Technique C to Master Skills - Multiple Selection 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
3:16
Learn Programming Technique C to MasterĀ Skills - First Program of Function ( Continue ...)
Tutorials Arena
11/3/2024
4:07
Learn Programming Technique C to Master Skills - Second Program of Loop (While Loop)
Tutorials Arena
10/17/2024
6:03
Learn Programming Technique C to Master Skills - Linked List ( Second Program)
Tutorials Arena
11/30/2024
5:33
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( While Loop )
Tutorials Arena
10/13/2024
5:15
Learn Programming Technique C to Master SkillsCharacter String Third Program (Flowchart)
Tutorials Arena
11/19/2024
8:18
Learn Programming Technique C to Master Skills - Loop Within Loop Program Explanation in Flow chart
Tutorials Arena
10/17/2024
5:02
Learn Programming Technique C to Master SkillsCharacter String Fourth Program (Flowchart)
Tutorials Arena
11/19/2024
8:08
Learn Programming Technique C to MasterĀ Skills - First Program of Function
Tutorials Arena
11/3/2024
12:26
Learn Programming Technique C to Master Skills - First Program of Array
Tutorials Arena
10/20/2024