how can i change the maximum recursion limit?

+1 vote
asked Oct 13, 2019 by Cam Mc (130 points)
I'm working on programming a function with a summation. My professor wants the summation to go up to 100,000 iterations, but currently I get an error message if I try to go above 250. I understand that 100,000 might be too many recursions for the compiler to handle, but I want to try to get at least more than only 250.

P.S. I know there are easier ways to perform a summation that would avoid this error, but my professor is very clear in his instructions that he wants it done in a while loop.

1 Answer

0 votes
answered Oct 18, 2019 by Samvel Barseghyan (150 points)
#include <iostream>
using namespace std;
int main()
{
    int x = 0;
    while(x< 100000)
    {
        x += 300;
    }
    cout << x;

    return 0;
}

thats work
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...