 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to explain how you can create series of or and even numbers. So here you can see two series are available. One is printing odd numbers and the second one is printing even numbers. So I will be implementing a program that will be in C language. So two separate programs will be implemented to create DC. Before starting, I want to share one information. If you go to detail or description of this video, you will find links of various players related to programming so you can watch them too. So now first I'm going to implement a program to create this odd number series. Then we can change, we can apply a minor change and then the program will be converted into printing even numbers. So here you can see I'm using two variables. One is I and second is N. Then I'm writing printer statement. So this printer will print enter value of N on output screen and that input number will be received by scanner and that will be stored inside N variable. So this program can be implemented in two ways. So here you can see 1, 3, 5, 7, 9 are printed and up to N. So we can say like two ways up to N or N times. So let's say N is 20. Let's say N is 30. So first method will say print all the odd numbers starting from 1 to 20. So the numbers which are odd between 1 to 20 will be printed and second scenario says print first 20 odd numbers, those are available starting from 1. So in both cases, output will be different. So first I'm going to write a program which will print odd numbers from those are available from 1 to 20 and then we can convert that as well. So for I equals to 1, I level equals to 20 and here I equals to I plus 2 and then print F percent B then a comma because after each visit we have comma displayed. So after percent B you can put a comma then double quotes then again comma and print value of I and close this loop. So here you can see first initial value of I is 1 then I level equals to 20 so condition is 2 so it will print 1. So this will be printed then I equals to I plus 2. So I is 1, 1 plus 2, 3 so new value of I equals to 3. So 3 less than 20 again through so it will print 3 and comma. So this way 1, 3, 5, 7, 9, 11, 13, 15, 17 and 19 will be printed right up to 20. So it is not printing 20 digits. It is printing odd numbers between 1 to 20. So I hope you understood this concept. So we are printing all the odd numbers up to n. Now I am going to convert this program, print odd numbers n times. So if n is 20 so we want 20 odd numbers to be printed on P. So in that case I can't use I like this. So I am repeating this loop 20 times by increasing I by 1. So I need one more variable, let's say S whose initial value is 1. So here I am printing S and this way I am incrementing value of S by 2. So this loop will be 20 times so first time I is 1 condition will be checked so S will print 1 because its initial value is 1 then it will become 3. So I will repeat second time so this time it will print 3 then I will repeat third time so S will print 5. So S will be printing 20 odd numbers. So this scenario is printing odd numbers n times right. So I explained you both of these. Now we need to print even numbers. So you need to do a minor change. So here you can see series is starting from 2. So in place of assigning 1 we can assign 2 here. In place of assigning 1 we can assign 2 here. So first time S will print 2 then 2 plus 2 4 so next time it will print 4 then 4 plus 2 it will print 6 and so on the digits will be printed. So this will print 20 even numbers. This logic will print 20 even numbers. If you want to print even numbers up to 20 then you can convert it into previous logic. So remove this S, place I here, start this loop with 2 and increase I by 2. So I am writing that loop again so you can do this right. You can do this starting from 2 incremented by 2 and here you can print the value of so this will print even numbers up to 20. So up to 20 and sorry up to n or n times both are different. So I explained you both the scenarios so I hope you understood whatever I explained in this video. If you want to watch more programming related videos you can open my channel. Go to playlist and there you can find various programming related videos to do more than and thank you for watching this video.