Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged scoping-rule
0
votes
0
answers
1
Gatebook test
Consider the following code. int a = 1; int b = 1; Function foo() { print(a); } Function bar(int x, int y){ int a = 0; foo() ; x = 0 ; b = b-y; r = Y+1; } Function foobar() { int r = 1 ; bar(r,b); print(b); print(r); ... So how will the function bar( int x,int y) access the variable 'r'?..it is local to fooBar()..i think this will throw compilation error..can anyone verify.
Consider the following code. int a = 1;int b = 1;Function foo() {print(a); }Function bar(int x, int y){int a = 0;foo() ;x = 0 ;b = b-y;r = Y+1;}Function foobar() {int r =...
Tridhara Chakrabarti
277
views
Tridhara Chakrabarti
asked
Dec 12, 2017
Programming in C
scoping-rule
programming-in-c
test-series
+
–
1
votes
2
answers
2
Dynamic Scope
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; b=4; c=a+b; a+=11; // here in case of dynamic scoping will //variable a of func1() be updated to a=6+11 ? print(c); } void main(){ a=3; b=5; c=7; func1(); } 7 19 10 1 10 23 10 32
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; ...
Ron111
2.0k
views
Ron111
asked
Nov 30, 2017
Programming in C
programming-in-c
scoping-rule
dynamic-scoping
+
–
3
votes
2
answers
3
scope of a macro definition
Choose the False statements: (a) The scope of a macro definition need not be the entire program (b) The scope of a macro definition extends from the point of definition to the end of the file (c) A macro definition may go beyond a line (d) None of the above
Choose the False statements:(a) The scope of a macro definition need not be the entire program(b) The scope of a macro definition extends from the point of definition to ...
sunil sarode
2.1k
views
sunil sarode
asked
Nov 4, 2017
Programming in C
programming-in-c
scoping-rule
+
–
0
votes
2
answers
4
Programming Scope of variables
The following program runs perfectly fine without showing compilation error. I am unable to understand why as 'c' is a local variable of 'function_addition'. So, shouldn't it throw an error? #include<stdio.h> int ... ambiguity as to why the first one prints the value of c correctly whereas the second program shows an error.
The following program runs perfectly fine without showing compilation error. I am unable to understand why as 'c' is a local variable of 'function_addition'. So, shouldn'...
Bongbirdie
945
views
Bongbirdie
asked
May 28, 2017
Programming in C
programming-in-c
scoping-rule
variable-scope
+
–
1
votes
1
answer
5
static
#include <stdio.h> int main() { static a=10; static b=15.56; printf("%d %d",a,b); } Output -> 10 15 Why without data type information , this program is running?
#include <stdio.h int main() { static a=10; static b=15.56; printf("%d %d",a,b); }Output - 10 15Why without data type information , this program is running?
Learner_jai
415
views
Learner_jai
asked
Mar 13, 2017
Programming in C
scoping-rule
+
–
0
votes
0
answers
6
STATIC SCOPING RULE ---CONFUSION!!
ANS GIVEN A=169 B=13 HOW??
ANS GIVEN A=169 B=13 HOW??
KISHALAY DAS
278
views
KISHALAY DAS
asked
Jan 10, 2017
Programming in C
programming
scoping-rule
+
–
2
votes
2
answers
7
CMI2016-A-10
Which of the following relationships holds in general between the $\text{scope}$ of a variable and the $\text{lifetime}$ of a variable (in a language like C or Java)? The scope of a variable is contained in the lifetime of the variable The scope of a variable is same as the lifetime of the variable The lifetime of a variable is disjoint from the scope of the variable None of the above
Which of the following relationships holds in general between the $\text{scope}$ of a variable and the $\text{lifetime}$ of a variable (in a language like C or Java)?The ...
go_editor
1.2k
views
go_editor
asked
Dec 30, 2016
Programming in C
cmi2016
programming-in-c
scoping-rule
lifetime
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register