 Hello friends. I'm Sanjay Bhukta. I welcome you on Sanjay Bhukta Tech School. In this video, I'm going to explain how you can implement Vibhaneke series program with the help of C. So first I will tell you what is Vibhaneke series, how its deserts are calculated. Then we will see a program. I will explain each and every step of the program so that you can understand how that program is implemented with the help of C. So let's see what Vibhaneke series is. So these are the terms or values of Vibhaneke series. So it starts with 0, then 1, 1, 2, 3, 5, 8 and so on. So what logic is there to build Vibhaneke series? So here you can see if we add two digits, then the addition of those two digits will be the outcome of next visit. So 0 plus 1 will become 1. Now if we add these two digits 1 plus 1, so outcome is 2. If we add these two digits, so outcome is 3. If we add these two digits, then outcome is 5 and so on. So after 8, visit will be 13. After 13, visit will be 21 because we added 13 plus add. Now if you add 21 and 13, so its outcome will be 34. So this way you can calculate digits of the Vibhaneke series and you can print this series with the help of C program. So now after understanding what Vibhaneke series is, I am implementing a small for loop that will print all the digits of Vibhaneke series up to n. So we are going to read value of n like how many digits of Vibhaneke series we want to print. So according to that input number, loop will work and after implementing the loop, I will explain each and every step of the loop so that you can understand how we can print Vibhaneke series with the help of C program. So starting with main, now here with the help of 8 data type, I am going to declare some variables. So I am declaring i and so i will be iterating the loop and will be receiving the value of that how many digits of Vibhaneke series we want to print. Then P0, P1, 1 and P2 equals to 0. So these three variables are also required. So T here stands for term. So term is 0, term 1 is 1 and term 2 is 0. So with these three variables, I am going to calculate the logic of algebra. If you want to use any other variable names then also you can use, so you can replace them instead of P, P1, P2. Then after declaring these three variables, I am going to print this message with the help of printer that is enter value of n to receive input from user. I am using scanner. So input number will be stored inside n. So let's say n is 6. We want to print 6 digits of Vibhaneke series. So it should print these values. 1, 2, 3, 4, 5 and 6 digits. So now I am going to implement a for loop. So loop will start from 1. It will iterate till n and inside this for loop I am going to write the logic. So here you can see i is initialized with 1. Addition is i as n equals to n. So n is 6. So this loop will repeat 6 times. And i++ will change value of 5 by 1. So inside this loop, first of all I am going to print. So these digits I want to print separated by comma. So see carefully inside double quotes I am using quantity and after quantity I am putting a comma. So that comma will be printed after each visit. Then closing the double quotes and again I am putting comma. If you want to print these digits like this. So in place of comma you can place backslash n. So digits will be printed on the line. So we can remove this and we can place backslash n here. So choice is yours in which order you want to print these numbers. So if you want to print horizontally you need to put comma. If you want to print them vertically you can use backslash n. So I am using comma here and here I am printing value of t. Then t equals to t1 plus t2. So I am adding term 1 and term 2. So the result will be stored inside t. Then t1 equals to t2 and t2 equals to t. And this way this loop is implemented. Right. Now we need to iterate this loop how this loop is going to calculate the numbers of people that you see. So n is fixed. So this time i equals 1. So printer will print value of t. So here I am writing initial values of all the videos. So t is 0, t1 is 1 and t2 is 0. So those are the here here. So first this loop will print value of t. So value of t is 0. So this digit will be printed along with comma. Then calculate this t1 plus t2. So t1 is 1, t2 is 0. So new value of t will be 1. So I am changing this value. Now t2 will be assigned into t1. So see current value of t2 is 0. That will go into t1. So t1 will become 0. Now we need to assign value of t into t1. Sorry, t into t2. So see value of t is current value of t is 1. So t2 will also become 1. So this way first iteration is completed. Now i plus this will take place. So I will be to check this condition. It is true. Then again printer will print the value of t. So now see current value of t is 1. So this one will be printed successfully. Again add both t1 plus t2. So t1 is 0 this time and t2 is 1. So again t will be having 1. Then assign t2 into t1. So here I think you already know we need to assign right hand side value to left hand side. So t2 is having 1. So t1 will be having 1 also because we are assigning value of t2 into t1. So t1 is 1. So sorry, t2 is 1. So t1 will also become 1. Now see current value of t it is 1. So it will assign 1 into t2. So it will be 1. So this time all t, t1 and t2 all three variables are having value 1. So this is second rotation. Now again we increase i plus plus. So i will become 3 this time. Check this condition. It is true. Now print value of t again. So what is the current value of t? It is 1. So again you can see 1 is printed. Now add these two values. So t1 is 1, t2 is also 1. So new value of t will be 2. Now assign t2 into t1. So t2 is 1. So t1 will also become 1. Assign t into t2. So t is 2. So t2 will become 2. Now third rotation is completed. i plus plus takes place. So new value of i will be 4. Check this condition. It is true. Now print value of t. So t's current value is 3. Sorry, 2. So 2 is printed successfully. Now add these two. t1 is having 1. t2 is having 2. So addition of both will be 3. So new value of t is now 3. Then what is the current value of t2 is 2. That will go into t1. So t1 will be 2. And current value of t will move to t2. So current value of t is 3. That will go into t2. So its new value is now 3. Now again i plus plus will take place. So this time i will be fine. Then condition is true. Print value of t. So current value of t is 3. So it will be printed. And we need to calculate this expression. So t1 is 2. t2 is 3. So 3 plus 2. t will be having 5. So add t1, t2. So 2, t. If we add both. So the new value is 5. That will be stored inside t. So this way you can see all the digits are calculated and we have printed. So here t is denoting current term. t1 is term 1 and t2 is term 2. And we are changing their values. So whatever will be in t2 will go to t1. Whatever is in t will go to t2. And t is having addition of t1 and t2. So that is the term that is calculated. So I hope you understood how this calculation is working because I explained each and every step. So now you can implement this program in your compiler or in your IDE. And if you want to print it horizontally, you can place a comma here. If you want to print it horizontally. If you print it horizontally, place comma. If you print it, if you want to print it vertically, then you can place dash slash and in place of comma. 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 and go to playlist. I uploaded more than 1000 videos related to C, C++, Java, Salesforce, Python, data structure. So you can explore those videos and you can learn programming. So don't afraid with programming because programming is very easy and I have uploaded all the videos related to programming in easy way. So watch them and do try to understand programming. Thank you for watching this video.