edited by
542 views
2 votes
2 votes
#include <stdio.h>
#include <stdlib.h>

int a,b,c =0;
void prtFun(void);
int main()
{
        static int a=1;
        prtFun();
        a+=1;
        prtFun();
        printf("\n%d %d ",a,b);
}
void prtFun(void)
{
        static int a=2;
        int b=1;
        a+=++b;
        printf("\n%d %d ",a,b);
}

What is the output ? Expalin how ?

edited by

1 Answer

Related questions

1 votes
1 votes
3 answers
1
jverma asked May 23, 2022
1,070 views
#include <stdio.h>int f(int n){ static int r = 0; if (n <= 0) return 1; r=n; return f(n-1) + r;}int main() { printf("output is %d", f(5)); return 0;}Ou...
0 votes
0 votes
0 answers
2
iarnav asked Jul 30, 2018
390 views
for every j != i in {0,....,n-1} is it like for j=0 to n-1; j !=i ; ++j
0 votes
0 votes
1 answer
3
srestha asked Nov 18, 2018
1,322 views
Is it static declaration or static assignment?int main() { int x=20; static int y=x; if(x==y) printf("Equal"); else printf("Not Equal"); return 0; }What is output?and why...