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 - Fourth Program of Loop ( Flow Chart )
Tutorials Arena
Follow
10/13/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hi I am Sandeep today I am going to explain that how to display the odd numbers but we
00:09
are not going to display the first three odd numbers this is the program of user choice
00:17
how many odd numbers we have to display okay so as many odd numbers we want we can display
00:25
that is according to our will okay so it's a user choice program let us understand for
00:32
that I have taken three variables I have taken for odd number od to count the odd numbers
00:39
I have taken i and how many times the loop is going to carry on for that I have taken
00:44
an extra variable n okay I have initialized the value of od that is 1 and I have initialized
00:51
the counter variable i equals to 1 now how many times the loop will carry on for that
00:57
I have to input the value inside this variable n suppose I have input 3 so this loop is going
01:06
to carry on for how many times three times so how many odd numbers I am going to get
01:12
I am going to get three odd numbers so let us do the try run 1 less than 3 as inside
01:18
n it is 3 and the value of i is 1 1 less than 3 the condition is true it will come
01:23
to the yes part it's going to display 1 okay then 1 plus 2 that is what 3 so inside od
01:31
it is 3 what is inside i it is 1 1 plus 1 that is what 2 so remember the values inside
01:38
od it is 3 inside i it is 2 the loop will carry on 2 less than 3 the condition is true
01:46
okay so it's going to print the odd number as the condition is true what was the value
01:52
of od it was 3 so it's going to display 3 now it will come to this equation 3 plus 2
01:57
that is what 5 just remember the values the value of od is what 5 it will come to the
02:04
counter variable 2 plus 1 that is what 3 so the new value of i is what 3 earlier value
02:13
is over written by the new value so the value of i is what 3 and the value of od is what
02:17
5 okay again the loop will carry on 3 equal to 3 as the value inside i is 3 and value
02:25
of n is what 3 so 3 equal to 3 the condition is true what is inside od it is 5 so 5 is
02:33
going to display okay then 5 plus 2 7 and 3 plus 1 4 again the loop will carry on 4
02:41
less than 3 the condition false no and stop okay so as we have given the value of n 3
02:48
so this loop carry on for 3 times if i give the value of n 2 so how many times this loop
02:55
is going to carry on for 2 times let us check value of i is 1 1 less than 2 the condition
03:02
is true so 1 is going to print and 1 plus 2 that is what 3 so the new value of od is
03:08
what 3 1 plus 1 that is what 2 it will check here 2 equals to 2 yes the condition is true
03:17
what is inside od it is 3 so 3 is going to print okay and then what 3 plus 2 5 and 2
03:24
plus 1 3 so 3 less than 2 as the value of n is 2 and the value of i is 3, 3 less than
03:31
2 the condition will get false and then stop so we get the two odd numbers 1 and 3.
03:36
So whatever the value is you are going to input inside n that times the loop is going
03:43
to carry on okay for that times the loop is going to carry on I hope you understand how
03:49
to use user choice program how to make it in the next video I am going to make the program
03:55
the same program okay in C. Thanks
Recommended
3:27
|
Up next
Learn Programming Technique C to Master Skills - Third Program of Loop ( Flow Chart)
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
5:33
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( While Loop )
Tutorials Arena
10/13/2024
3:52
Learn Programming Technique C to Master Skills - Second 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:54
Learn Programming Technique C to Master SkillsCharacter String Fifth Program ( Flowchart)
Tutorials Arena
11/19/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (Flowchart)
Tutorials Arena
10/13/2024
5:02
Learn Programming Technique C to Master SkillsCharacter String Fourth Program (Flowchart)
Tutorials Arena
11/19/2024
5:29
Learn Programming Technique C to Master Skills - Continuous If Program (Flow Chart)
Tutorials Arena
10/8/2024
9:14
Learn Programming Technique C to Master Skills - Fourth Program (Call by Reference)
Tutorials Arena
11/8/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
8:18
Learn Programming Technique C to Master Skills - Loop Within Loop Program Explanation in Flow chart
Tutorials Arena
10/17/2024
4:55
Learn Programming Technique C to Master SkillsCharacter String Second Program (Flowchart)
Tutorials Arena
11/19/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
6:52
Learn Programming Technique C to Master Skills - Fourth Program - (Call by Reference - continue..)
Tutorials Arena
11/8/2024
7:35
Learn Programming Technique C to MasterĀ Skills - Fourth Program of Function
Tutorials Arena
11/3/2024
5:15
Learn Programming Technique C to Master SkillsCharacter String Third Program (Flowchart)
Tutorials Arena
11/19/2024
5:02
Learn Programming Technique C to Master Skills - Third Program of 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
7:30
Learn Programming Technique C to MasterĀ Skills - Fifth Program of Function
Tutorials Arena
11/3/2024
12:37
Learn Programming Technique C to Master Skills - Fourth Program of Array
Tutorials Arena
10/20/2024
8:01
Learn Programming Technique C to Master Skills - Loop Within Loop Program
Tutorials Arena
10/17/2024
3:20
Learn Programming Technique C to Master Skills - Multiple Selection Program (Flow chart)
Tutorials Arena
10/12/2024