• closed by
1,097 views
1 1 vote
closed as a duplicate of: made easy
can anyone explain by using static and dynamic programing ? what will be output for static and dynamic?

   #include<stdio.h>
int x=10;
void part1(int *a)
{
*a+=x++;
printf("%d",*a);
}
void part2(int *b)
{
static x=15;
*b=*b*x;
part1(&x);
printf("%d",x);
}
void main(){
part2(&x);
part1(&x);
}

1 Answer

Position:
Show:

Related questions

0 0 votes
0 0 answers
1.7k
1.7k views
saumya mishra asked Dec 16, 2017
1,669 views
Can anyone please explain what is the answer to this question by static and dynamic scoping?
15 15 votes
1 answers 1 answer
6.4k
6.4k views
firki lama asked Jan 9, 2017
6,445 views
int a=0,b=0; int main(void) { int a=3; printf("%d%d",a,b); c(); printf("%d%d",a,b); return 0; } void c() { printf("%d%d",a,b); a=4,b=5; printf("%d%d",a,b); d(); printf("%...
7 7 votes
3 answers 3 answers
10.2k
10.2k views
4 4 votes
4 4 answers
2.7k
2.7k views
Aspi R Osa asked Dec 10, 2015
2,736 views
Indicate results of the following program if the language usesi)Static scope rule andii) Dynamic scope rules (GATE-1989)var x,y:integer;procedure A(var z:integer);var x:i...