top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C: Increase the value of variable in the recursive function without using global or static variable?

0 votes
445 views

I have a recursive function as below,

void func()
{
       if(counter>10)
              return;
       func();
}

Here, I need to come out of the function when counter reaches specific number(10 as per example).
Now, the condition is, I can't take this counter as global or static or can't pass this counter as parameter.

Any suggestion to solve this given above terms.

posted May 30, 2018 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

How can I wwap value two variables without using third variable or +/- operator?

+4 votes

in case if is it possible, how you can change and pls explain with some example.

0 votes
#include <stdio.h>
#include<math.h>
int main()
{

  printf("%.0f",pow(2,1023));

  return 0;
}

Output: 89884656743115795386465259539451236680898848947115328636715040578866337902750481566354238661203768010560056939935696678829394884407208311246423715319737062188883946712432742638151109800623047059726541476042502884419075341171231440736956555270413618581675255342293149119973622969239858152417678164812112068608

Now question is how is it achieved for such a big number?

...