recategorized by
1,217 views
0 votes
0 votes
#include<iostream>
using namespace std;

int i=0;
void a()
{
i+=1;
cout<<i<< ".hello"<<endl;
a();
}

int main()
{
a();
}

For this above code the output is only upto →  64891.Hello

Does this mean that that the stack can hold only 64891 recursive calls? (I am using dev c++)

recategorized by

1 Answer

1 votes
1 votes
I run the same code in ubuntu terminal and each time I executed the code, it shows me a different value of 'i' around 5 lakhs with a message segmentation fault (core dumped)

Related questions

2 votes
2 votes
3 answers
1
Laahithyaa VS asked Sep 9, 2023
934 views
. What will be the value returned by the following function, when it is called with 11?recur (int num){if ((num / 2)! = 0 ) return (recur (num/2) *10+num%2);else return 1...
5 votes
5 votes
2 answers
3
shaurya vardhan asked Nov 2, 2017
1,668 views
Consider the following functionVoid func(int n){Int k=n;Int i=0;for(;i<n;i++){while(k>1){k>>=1;}}What is the worst case time complexity of the function?
4 votes
4 votes
1 answer
4