@@apmotivationakashparmar722 n = 5 so fib(5) = fib(4) + fib(3) ho gya But iske bad ye dubara se jab run hoga to fib(4) ke liye fib(4-2) = fib(2) Fib(4-1) = fib(3) And fib(3) ke lye fib (3-1) = fib(2) Fib(3-2) = fib(1) Banega but lecture me fib(1) to kahi hai hi nhi
While calculating the factorial of very big number, we get zero since computers try to give the answer in exponential form. So, to get the actual result, change the data type of the function to double to get the exact value. Hope this helps!
Actually, I wanted to calculate the factorial of 100 but it gave 0 as an answer...I was confused. But because of your advice, I changed int to double and I got the correct answer. Thank You!
We can also do this by using Array, It decreases the execution time. 1. Factorial : int fact(int n){ int a[100]; a[0] = 0, a[1] = 1, a[2] = 2; for(int i = 3;i
bhaiya is factorial wale tarike se aur harry bhaiya ke tarike se bhi 20! ka ans nhi aa rha ans negative m de deta h koi solution is ko solve krne ka for greater integer values
@@ayushparmar7729 bhai 20 ka factorial itna badha hota h ki int mi nhi aa sakta kyuki int ki range -2147483648 to 2147483647 hoti h aur iska factorial quadrillion mei h
2:52 n! = n*(n-1)! It is correct . Let we take example : Factorial of 5 = 5×4x3x2x1 . Instead of multiplying like above we should first calculate factorial of 4 and then multiply it with 5 . Now we get factorial of 5.
Giving some question that You can practice 1)Write a program which displays the largest among 2 No. 2)Write a program which displays grade on basis of marks 3)Find the roots of quadratic equation 4) To find year enter by user is a leap year or not 5)To find operation of 2 No. enter by the user by (Switch) method{+,-,*,%,/)etc. 6)To find operation of 2 No. enter by the user by (if else ladder) method 7) using goto feature create a multiplicative table 8)Sum of digit of integer enter by user by (goto) statement{EX- 76 = 13} 9) Sum of n natural numbers using (for) statement 10)To Find factors of No. enter by user 11)To find to Reverse of Digit 12)To state whether no. enter is Penedrom or not 13)To find No. is prime or composite Agar inke code cheye to message me . Please Pin this student ki help hogi bhot isse ache questions hain
Wasa ap boht amazing ho sar manna padaga he is so amazing apki explanation to ItnA excellent ha ka na bhi samajh aya to ap samjha hi data han ItnA àcha aj tak mujha kisii na koi topic nhi samjhaya you are the best for explained every topic thank you so much sir thanks
fib(5) // fib(4) + fib(3) // fib(2) + fib(3) + fib(2) + fib(3) harry bhai ap ne is mai ghalti krdi hai mai tou cinfused hogaya tha pehle ab clear hogaya
@@niteshbovi769 well i am not a professional in this topic as I learned which i like to do in dsa like question solving and I Don't follow a roadmap. So i can't give you roadmap for this.
Write a C ++ Program. We have a day-to-day record of USD price in PKR for last 100 weeks. Find the week, which has a highest variation in PKR, while a base price is 160Rs = 1 USD. Also, find which week has the highest average USDprice Sir Please Solve The Problem
finally mere ko recursion samajh me aagaya mene java playlist me ek baar video dekha to mere ko utna samajh me nahi mene dusri baar dekhna ka socha procasination hoto gayi!
I really love all of your videos BUT please change your chrome browser theme to DARK MODE because when you switch from vs code to chrome browser it hurt my eyes badly because we are so focused on your video and suddenly going from black screen to white screen really hurt eye cornea and I cant tolerate that feeling anymore please take this note on a serious measure...btw love your teaching style and keep it on!
Can you give practice uestions after every lecture
N(N-1)! = Katai jahar concept bilkul sahi paaji😂😁
dedo ♥️♥️♥️♥️♥️♥️
12th maths padhi hoti toh tujhe zeher nhi lagta ekdum basic hai ye
@@nirmalbuoy 11th maths be
@@palashagrawal2343 Ha wahi jo bhi hai, hume JEE coaching ke waqt aisa kuch 11th 12th nahi padhaya tha isiliye pata nahi kaunse class me aata hai
11th maths Padhi nahi hai aapne bca wale ho na
Halwa hai😂😂
Sir, jab samajh me awajata hay, to video ending song bohat acha lagtahay.
fib(5)=fib(4) + fib(3) = fib(2) + fib(3) + fib(2) + fib(1) should in place of fib(2) + fib(3) + fib(2) + fib(3).
yes
Ye chij mujhe samaj ni aayi ki Harry bro ne kaise toda
Could you pleas explain me?
fib(n) = fib(n-1) + fib(n-2) apply this .
@@apmotivationakashparmar722
n = 5 so fib(5) = fib(4) + fib(3) ho gya
But iske bad ye dubara se jab run hoga to
fib(4) ke liye fib(4-2) = fib(2)
Fib(4-1) = fib(3)
And fib(3) ke lye fib (3-1) = fib(2)
Fib(3-2) = fib(1)
Banega but lecture me fib(1) to kahi hai hi nhi
@@anju7334 Jab fib(1) meh jayega toh value toh 1 return karega kyuki n
//Author:Harman kaur
//purpose:fibonacii series
#include
using namespace std;
int fib(int n)
{
if (n < 2)
{
return 1;
}
else
{
return fib(n - 1) + fib(n - 2);
}
}
int main()
{
int num;
cout num;
cout
what will be the iterative approach he is mentioning is it with the help of loops
Thank you! Needed this for an assignment
competitive programming pe series bana bhai, Please!
Do you find cp series???
@@SK-gp6cm wow 2 years back
Yes many series are there, I also bought a course on udemy but it is more of DSA focused rather than cp
@@Abhishek-dp5tc can you share that link
Bro where can i practice question or should i practice question or first complete whole series of c++ here
@@Ramneet04 first complete this series
Loving this playlist.
Day-12
Completed upto Tutorial-18
Date-14/12/2022
Time-19:32
Topic-Recursions and Recursive Functions
bro are u from cs / it branch?
@@sayman099 yes bro,i am from it branch.
@@AnEngineerHuman CPP DONE???
@@sayman099 TUM KONSE BRANCH SE HOO??
@@pratikingle3963 ha ,keh sakte ho .Par jada practise nahi hui...
Thanks for reminding me
7:55 what a clear Explanation
Legendary 😃
3:06 ----> this is correct
11:42 if(n
Ur explanation is Just amazing👍👍👍👍👍The Best
I can't even imagine a world without stack overflow and codewithharry!
can u tell me how 2 returned in fibbonacci at 3?
@@seasonalmind7241 f(3) = f(2)+f(1) = [f(1)+f(0)] + f(1) = f(0) + 2 f(1) = 1 + 2(1) = 1+2 = 3. Makes sense?
@@desiquant yeah it definitely does.Thanks.
increase u r imagination
In the fib function, the base case returns 1 for n
While calculating the factorial of very big number, we get zero since computers try to give the answer in exponential form. So, to get the actual result, change the data type of the function to double to get the exact value. Hope this helps!
Actually, I wanted to calculate the factorial of 100 but it gave 0 as an answer...I was confused. But because of your advice, I changed int to double and I got the correct answer. Thank You!
@@AnushkaPandey-h2c Happy to know that the solution I gave, helped somebody :) ! This made my day :)
Bhai datatype long used karke dekh
@@Sports-im6yveven better long double😊
@@bansilalnabediya3501 thanks bhai ❤
We can also do this by using Array, It decreases the execution time.
1. Factorial :
int fact(int n){
int a[100];
a[0] = 0, a[1] = 1, a[2] = 2;
for(int i = 3;i
bhaiya is factorial wale tarike se aur harry bhaiya ke tarike se bhi 20! ka ans nhi aa rha
ans negative m de deta h
koi solution is ko solve krne ka for greater integer values
@@ayushparmar7729 20 ka factorial?
@@ayushparmar7729 bhai 20 ka factorial itna badha hota h ki int mi nhi aa sakta
kyuki int ki range -2147483648 to 2147483647 hoti h aur iska factorial quadrillion mei h
@@kartikbisht1909 bhai vo to ho gya tha jo bhi digit calculate krke aa rhi h use array m store krte joa aur pos pointer ko +1 krte jao
@@ayushparmar7729 ook
2:52
n! = n*(n-1)!
It is correct .
Let we take example :
Factorial of 5 = 5×4x3x2x1 .
Instead of multiplying like above we should first calculate factorial of 4
and then multiply it with 5 . Now we get factorial of 5.
Hme bhi ata hai
@@programinglife.1400 😂😂
Awesome video
Question of 03:00
yess
I realized something that all the people who are watching this to learn c++ are building there programming style a lot similar to harry bhai's
You have made my coding life easy
Superb... 👍👍👍
👍👍👏Excellent explanation.
16:00 It should be like this. Fib(3)= Fib(2)+Fib(1)...correct me if I'm wrong.
I think you are right since I was searching for this comment as well
Giving some question that You can practice
1)Write a program which displays the largest among 2 No.
2)Write a program which displays grade on basis of marks
3)Find the roots of quadratic equation
4) To find year enter by user is a leap year or not
5)To find operation of 2 No. enter by the user by (Switch) method{+,-,*,%,/)etc.
6)To find operation of 2 No. enter by the user by (if else ladder) method
7) using goto feature create a multiplicative table
8)Sum of digit of integer enter by user by (goto) statement{EX- 76 = 13}
9) Sum of n natural numbers using (for) statement
10)To Find factors of No. enter by user
11)To find to Reverse of Digit
12)To state whether no. enter is Penedrom or not
13)To find No. is prime or composite
Agar inke code cheye to message me .
Please Pin this student ki help hogi bhot isse ache questions hain
Sir please provide practice questions also
we can also find factorial using static as in previous video.
How? I tried but it isn't possible without recursion or looping.
Wasa ap boht amazing ho sar manna padaga he is so amazing apki explanation to ItnA excellent ha ka na bhi samajh aya to ap samjha hi data han ItnA àcha aj tak mujha kisii na koi topic nhi samjhaya you are the best for explained every topic thank you so much sir thanks
make a complete course on data structure and algorithum
please sir
Already there on channel bro 😃😃
@@sanatani_raj462 Tu 10 mahine baad reply karega ...toh woh bana liya hoga naa ????
Iterative approach for fibonacci.
#include
using namespace std;
void fibonacci(int n){
int a =0;
int b=1;
int sum =0;
cout
You are the most intelligent programmer in the India
3:08 yes Harry Bhai we can write.
recursions means a function is calling itself on its own until it gets the answer
Yes, n!=n*(n-1)!.
Thanks Harry Bhaiya
You are same like my sir very understanding
Teaching method is awesome👍👏
bro pls practice set bana do us se aur bhi zyada confidence aa jaata hai jab saare questions complete krleta hu
yes, we write n*(n-1) to the n!
Love these content
For calculation nth term we can use a+(n-1)d, where a is 1st term and d is common difference
that's for constant series, but here the common difference is changing
Ha..it is the staple equation where the difference is fixed
3:07 yes you can write.
fib(5)
// fib(4) + fib(3)
// fib(2) + fib(3) + fib(2) + fib(3)
harry bhai ap ne is mai ghalti krdi hai mai tou cinfused hogaya tha pehle ab clear hogaya
2:55 Yes it is factorial
Sir you make programing easy for me really thank you SSO much.....
IN last 16:30 - I will see you next time...... BGM(totally incredible)
2:51 sahi hoga kyuki yahi formula hai factorial nikaalne ka
Your teaching is awesome
Well enjoying the tutorial
3:08 yes it can be written
Data structures aur algorithm pe playlist 🙏🙏🙏🙏
go to geeksforgeeks until codewithharry sir upload Data structures and algorithms
@@nikhilraj1842 thanks
@@nikhilraj1842 can u plz tell me the roadmap for programming language with dsa
@@niteshbovi769 well i am not a professional in this topic as I learned which i like to do in dsa like question solving and I Don't follow a roadmap.
So i can't give you roadmap for this.
Write a C ++ Program. We have a day-to-day record of USD price in PKR for last 100 weeks. Find the week, which has a highest variation in PKR, while a base price is 160Rs = 1 USD. Also, find which week has the highest average USDprice
Sir Please Solve The Problem
Question mein to logic hain wahh
12:57 for n
thanks bhai
recursion means function call itself again an again until result is found
finally mere ko recursion samajh me aagaya mene java playlist me ek baar video dekha to mere ko utna samajh me nahi mene dusri baar dekhna ka socha procasination hoto gayi!
Bhai Competitive Programming pr series banao please
recursion function is also known as aatmnirbhar function
oooo
Fibonacci Series 0 se start hota hai. 12:46 par n sahi tha. Aapne 1 kar diya anways bade bade sahro me chotti chotti baat hote rahti hai
yes u can it as factorial✅
Teaching method is awesome
Thank Harry 😊
good teacher
Recursion is just a function calling itself inside itself
3:06 yes! likh sakte hai
Your way of teaching is really awesome . But I have one request can u plz written program separately , sometime it's confusing and irritating too...
yeah even I felt the same
I really love all of your videos BUT please change your chrome browser theme to DARK MODE because when you switch from vs code to chrome browser it hurt my eyes badly because we are so focused on your video and suddenly going from black screen to white screen really hurt eye cornea and I cant tolerate that feeling anymore please take this note on a serious measure...btw love your teaching style and keep it on!
thank you sir
yes likh sakte hai
3:06
Yes.
Thank you, Harry bhai!
Thank you Harry bro
thnk u soo much for this, its really helpful for me
thanks harry bro
Yes we can write n*(n-1)!
yes we can
yes you are right
Yes true Hogi n!
It will be
If(n
yes you are correct
You are the best
Yes Sir, n! = n * (n-1)!
Yes we can write 3:07
Upload a video on factorial of large numbers like 100 and more.
It can be done if ur pc performance is extreme...
2:46
Yes It is correct
ye baat sahi hongi
3:05 yes
सही बात है।
yes we can write it
bilkul sahi baat hogi
Thankyou so much sir🙏🏻😁
Sir , ye video enough h ya fir particle exercise bhi karni padegi
yes we can write it tthat way
Best Explination Sir, Very Nice Video
Yes thk haie..❤
Ha likh sakte hai 😀👍🏻....
we can write factorial n *(n-1)
Muje bohot achhe se samj aa gaya thank you sir 😭😭😭
toh ro kyu rahe ho?
@@satyaanand9243 hay tum bhi dsa sikh rahe ho kay?? Please reply karna
3:07 yes we can
Harry Bhaiya competitive programming ka bhi course nikaliye
3:05 Obviously sir
time 2:53
Yes , ture , n! = n * ( n -1)
yes ❤
yes likh sakty hain (n-1)
Yesh we can write