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 - Second Program of Loop (Flow Chart)
Tutorials Arena
Follow
10/17/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hello everyone, I am Sandeep.
00:05
In today's video I am going to explain that how to display square of first three odd numbers.
00:14
So we know the first three odd numbers are 1, 9 and 25.
00:21
For that here I have taken three variables for odd numbers I have taken od, to count
00:28
I have taken i, this is the counter variable and to calculate the odd number I have taken
00:34
what as q.
00:35
I have defined the value of od for the odd number 1 and I have defined the value of i
00:41
that is equals to 1.
00:43
We need the first three square of odd numbers.
00:48
So this loop is going to carry for how many times, for three times.
00:53
Now let us do the dry run and understand it.
00:55
The value of i it is 1, 1 less than 3 condition is true, it will come to the yes part.
01:02
What is inside od it is 1 so 1 into 1, 1 into 1 so the resulted value is going to store
01:10
inside as q that is what 1 and it's going to display.
01:15
So see we got the first square of odd number but we need other odd numbers also so that
01:23
we can do the square of it for that the equation is here that is od equals to od plus 2.
01:31
So what is value of od it is 1, 2 is going to add with it so 1 plus 2 it is what 3.
01:36
So the new value inside od is what 3, we have to count it also so we have given equation
01:43
here i equal to i plus 1.
01:45
What is inside i it is 1, 1 is added to it so 1 plus 1 that is what 2.
01:52
So just remember the values, the values of od is what 3, the value of i it is what 2.
01:58
Now the loop will carry on, 2 less than 3 as the value inside i it is what 2.
02:05
So 2 less than 3 condition is true, it will come to the yes part.
02:10
What is inside od it is 3 so what 3 into 3 and the resulted value 9 is going to store
02:19
inside sq so it's going to print sq that is what 9.
02:25
Now again it will come to the equation what is inside od it is 3, 2 is going to add with
02:31
it so the new value inside od is what 5.
02:34
It will come to the counter variable what is inside i it is 2, what is going to add
02:41
with it that is 1 so 2 plus 1 3.
02:45
Now the new value inside i is 3 and the new value inside od is what 5.
02:51
Again the loop will carry on, it will come here and value of i is 3 so 3 equals to 3
03:00
the condition is true, it will come to the yes part and what is inside od it is what
03:06
5 so 5 into 5, 5 into 5 that is what 25 so it's going to print what 25.
03:15
It will come to this equation 5 plus 2 7, it will come to this equation 3 plus 1 4 again
03:24
it's going to check the condition 4 less than 3.
03:28
Now this time the condition will get false so the loop will terminate it will come to
03:33
the no and then stop but we get the result that is 1 9 and 25.
03:41
So this is the dry run of the program in the next video I am going to create this program
03:47
in C. Thanks.
Recommended
3:51
|
Up next
Learn Programming Technique C to Master Skills - First Program of Loop (Flowchart)
Tutorials Arena
10/13/2024
3:27
Learn Programming Technique C to Master Skills - Third Program of Loop ( Flow Chart)
Tutorials Arena
10/17/2024
4:57
Learn Programming Technique C to Master Skills - Loop With If Statement Program ( Flow Chart )
Tutorials Arena
10/13/2024
4:01
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( Flow Chart )
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
5:29
Learn Programming Technique C to Master Skills - Continuous If Program (Flow Chart)
Tutorials Arena
10/8/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (For Loop)
Tutorials Arena
10/13/2024
4:55
Learn Programming Technique C to Master SkillsCharacter String Second Program (Flowchart)
Tutorials Arena
11/19/2024
4:07
Learn Programming Technique C to Master Skills - Second Program of Loop (While Loop)
Tutorials Arena
10/17/2024
4:54
Learn Programming Technique C to Master Skills - Single If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
2:58
Learn Programming Technique C to Master Skills - Nested If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
3:55
Learn Programming Technique C to Master Skills - First Program of Loop (While Loop)
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
6:03
Learn Programming Technique C to Master Skills - Linked List ( Second Program)
Tutorials Arena
11/30/2024
9:09
Learn Programming Technique C to Master Skills - Second Program( Call by Reference)
Tutorials Arena
11/8/2024
8:07
Learn Programming Technique C to Master Skills - Loop with if Statement Second 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:33
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( While Loop )
Tutorials Arena
10/13/2024
8:18
Learn Programming Technique C to Master Skills - Loop Within Loop Program Explanation in Flow chart
Tutorials Arena
10/17/2024
8:01
Learn Programming Technique C to Master Skills - Loop Within Loop Program
Tutorials Arena
10/17/2024
5:02
Learn Programming Technique C to Master Skills - Third Program of Loop
Tutorials Arena
10/17/2024
5:59
Learn Programming Technique C to Master Skills - File Handling Second Program (Continue..)
Tutorials Arena
11/18/2024
4:14
Learn Programming Technique C to Master Skills - Explanation of Second Program
Tutorials Arena
10/8/2024
2:34
Learn Programming Technique C to MasterĀ Skills - Second Program of Function ( Return Val) - I
Tutorials Arena
11/3/2024