Recent questions tagged dynamic-scoping

1.1k
views
4 answers
2 votes
How will you free the allocated memory?remove(var-name)free(var-name)delete(var-name)dalloc(var-name)
502
views
1 answers
1 votes
int x = 5, y = 10 ; void main ( ) { int i = 2, j = 3 A (i, j); } void A (int i, int j) { int x = 10, y = 5 ; i = i + x ... scoping6.Dynamic scopingAny reference for call by name and call by needIs for static coping $12,17,54$ or $12,17,59$?
2.2k
views
2 answers
1 votes
#include<stdio.h> int x=10; int main() { static int x=10; x+=f1()+f2()+f3()+f1(); printf("%d",x); return 0; } int f1(){static int x=25;x++;return ... int f3(){x*=10;return x;}What is the output of the above code, if dynamic scoping is used.
345
views
1 answers
0 votes
Are any modifications to the value of a dynamically scoped variable persistent even after the function (in which modifications were made) returns? ... scoped variables essentially act like global variables in this particular regard?
505
views
2 answers
0 votes
Q. int k; fun(int i) { k = i + 3; printf(k); } gun( int i) { int k = 4; k = i+4; fun(k); printf(k); } main(){ k=2 ; gun(k); printf(k ... - 9,6,2 ( here last print statement i have doubt ..it will print 2 or 9)dynamic scoping- 9,9,2
945
views
1 answers
3 votes
How to solve any dynamic scoping question . Plz describe in detail.
2.2k
views
2 answers
1 votes
What is the output of the following program if dynamic scoping is used? int a,b,c; void func1() { int a,b; a=6; b=8; func2(); a=a+b+c; print(a); } void func2(){ int b,c; ... (c); } void main(){ a=3; b=5; c=7; func1(); }7 1910 1 10 23 10 32
472
views
2 answers
3 votes
int i=10;main(){int i =5,k,i=6;printf("enter value");scanf("%d",&k);if(k>0){fun1();}else{fun2();}}void fun1();{printf("%d",i);}void fun2();{int i=5;printf("%d",i);fun1();}what will the output using dynamic scoping?
4.2k
views
1 answers
13 votes
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(); ... ,a,b); } void e(int b,int a) { printf(a,b); a=7;b=8; printf("%d%d",a,b); }
To see more, click for the full list of questions or popular tags.