This function is return type as this function is returning value of x*y. But you write void fact(int n) { //code here } i think it should be like this int fact(int n){ //code here }
recursion function is automatically popped out from the stack when the iteration of the function is over.. In this video he had explained this concept .. when the if condition satisfied the compiler starts returning x*y and updates y value respectively... and when all x*y finished the value will stored at x . At line 3, compiler removes all recursions from the stack ... :)
Sir please can you explain one simple thing? Sir, you said in scope and lifetime of variables the fact function lifetime has expired so its return value cant be accepted... so how r we accepting here? i am getting confused... Sir please clear the matter! please Sir
I clearly understood the whole concept..Thanks a lot sir for your efforts!
This function is return type as this function is returning value of x*y. But you write
void fact(int n) {
//code here
}
i think it should be like this
int fact(int n){
//code here
}
👌
awesome explanation..thank u sir
kudos to you sir!
fact function return type is wrong . bro correct it .
thank you sir, very helpful video
Bahuth acha
Recursion is encountered.
8:47
Thanks a lot sir😍.
sir ..thank you for your effort...would you please upload a video for how to remove recursion using stack?
recursion function is automatically popped out from the stack when the iteration of the function is over.. In this video he had explained this concept .. when the if condition satisfied the compiler starts returning x*y and updates y value respectively... and when all x*y finished the value will stored at x . At line 3, compiler removes all recursions from the stack ... :)
Sir please can you explain one simple thing? Sir, you said in scope and lifetime of variables the fact function lifetime has expired so its return value cant be accepted... so how r we accepting here? i am getting confused... Sir please clear the matter! please Sir
if you are returning reference than it would be a problem..but if you use call by value it wouldn't be a problem
the data type of fact() must be int.
college professors are worst , thanks sir
u cant return two element
it's returning one element (x*y)
but it's void so it can't return
@@misterkid the return type is int .
He had cleared that in the paid course .