 Hello friends. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I am going to explain how you can print natural numbers in increasing as well as in decreasing order in C program. So here you can see two series are written. So first is printing natural numbers in increasing order like 1, 2, 3, 4, 5, up to n. And second is printing natural numbers in decreasing order like n, n minus 1, n minus 2, n up to 1. So what we need to do to implement this program, first we need to read value of n, till where you need to print natural numbers. So in case of increasing series, it will always start from 1 and it will go to n. In case of decreasing, it will start from n and it will decrease to 1. So now I am going to implement this increasing series program first. Then I will tell you how easily you can convert that into decreasing 1. So starting from me, first I am declaring a variable. So first is i and second one is n. So n will be leading the value of n, that is the termination point and i will be used for loop component. Now printf. So it will read value of n from user, then scanf. So along with printf and scanf, we can read value of n from the user. So printf will print this message on the output screen and whenever user press a particular value for n, so that will be distributed inside n variable user scanf. Now after reading value of n, I can implement a for loop. So for loop will start from 1, its termination condition will be this. i less than equals to n and i plus plus. And here I can write %d and here you can see after each digit comma is printed. So I can do that also. So after %d you can just put a comma, then close these double quotes, again put a comma and then print value of n. So this way you need to implement this for you and then you can complete the main function. So now if we see the rotation cycle, so let's say n is 7. So we need to print the natural inputs from starting from 1 up to 7. So this loop will start from here. It will check its condition. So 1 is less than equals to n. Condition is 2 this time and it will print this statement. So %d comma. So I will be printed here. So 1 comma will be printed from output. Right. Then from here it will move to increment part. So i plus plus means I will be incremented by 1. So initially I was 1. Now I will become 2. So from increment it will move to partition checking because initialization takes place only once. So this time also partition is true. So again printer will print 2 and comma. And this way this loop will repeat till 7. Then value of 5 will become 8. This loop will be terminated and on output screen you will be having all the natural numbers started from 1 to 7. Right. And whenever you execute this program, you can put different value for n so that you can have different keys and so on. So this is the solution of this one that that to print natural numbers in increasing order. Now how we can convert this for decreasing one. So you just need to change the initialization which will be i equals to n. Then you need to modify the termination condition which will be i greater than equals to 1. So loop will begin from n and it will go to 1 and in place of i plus plus we need to do i minus. Rest of the things will remain same. So this in this scenario you can see i will begin from n. So n is 7. So initial value of i will be 7. 7 is greater than equals to 1. So it is true. Then 7 comma will be printed. Then i will be decremented by 1. So right now i is 7. So it will become 6. 6 is greater than equals to 1. So then 6 comma will be printed. Then i will become 5. 5 is again greater than equals to 1. So this way this loop will repeat till 1 when i will become 0. So this loop will be terminated and the decremented natural number series will be printed out. So this way i explained you how you can print natural numbers in increasing order as well as in decreasing order. One more thing if you want to print these values like this in vertical order. So in place of comma you can put backslash and here. So by putting backslash in here all the digits will be printed in separate lines so you can do that as well. 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 will see various programming related videos. So do watch them and thank you for watching this video.