1,892 views
0 0 votes
void abc()

{

auto int a;

static int s;

a=s++;

printf("%d%d",a,s);

if(a<=2)

abc();

printf("%d%d",a,s);

}

void main()

{

abc();

abc();

}

how many times printf will execute??

1 Answer

Position:
Show:

Related questions

8 8 votes
3 3 answers
375
375 views
GO Classes asked Jun 17
375 views
What is the output of the following code?#include <stdio.h void update(int n, int *p) { if (n <= 0) return; *p = *p + n; update(n - 2, p); *p = *p + n; } int main() { int...
6 6 votes
2 2 answers
318
318 views
GO Classes asked Jun 17
318 views
What is the output of the following code?#include <stdio.h int fun(int n) { int x = n; if (n <= 0) return 0; x = x + 2; return x + fun(n - 2); } int main() { printf("%d",...
5 5 votes
4 4 answers
329
329 views
GO Classes asked Jun 16
329 views
What is the output of the following code?#include <stdio.h void g(int n); void f(int n) { if (n <= 0) return; printf("F%d ", n); g(n - 1); printf("f%d ", n); } void g(int...
6 6 votes
3 3 answers
308
308 views
GO Classes asked Jun 16
308 views
What is the output of the following code?#include <stdio.h void fun(int n) { static int x = 0; if (n == 0) return; x++; printf("%d:%d ", n, x); fun(n - 1); printf("%d:%d ...