344 views

2 Answers

0 votes
0 votes
A is correct option.

#include <stdio.h>
static int x;
void main()
{
// code
}
if this program is stored in file y, then this global variable x will remain global to this file only.

Related questions

1 votes
1 votes
3 answers
1
jverma asked May 23, 2022
1,031 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
1 answer
2
srestha asked Nov 18, 2018
1,253 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...
2 votes
2 votes
1 answer
4