Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged variable-scope
1
votes
2
answers
1
UGC NET CSE | June 2005 | Part 2 | Question: 11
After $3$ calls of the $c$ function bug ( ) below, the values of $i$ and $j$ will be : int j = 1; bug () { static int i = 0; int j = 0; i++; j++; return (i); } $i = 0, j = 0$ $i = 3, j = 3$ $i = 3, j = 0$ $i = 3, j = 1$
After $3$ calls of the $c$ function bug ( ) below, the values of $i$ and $j$ will be :int j = 1; bug () { static int i = 0; int j = 0; i++; j++; return (i); }$i = 0, j = ...
go_editor
1.5k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
+
–
1
votes
8
answers
2
UGC NET CSE | June 2005 | Part 2 | Question: 12
Find the output of the following $“C”$ code : Main() { int x=20, y=35; x=y++ + x++; y=++y + ++x; printf (“%d, %d\n”, x, y); } $55, 93$ $53, 97$ $56, 95$ $57, 94$
Find the output of the following $“C”$ code :Main() { int x=20, y=35; x=y++ + x++; y=++y + ++x; printf (“%d, %d\n”, x, y); }$55, 93$$53, 97$$56, 95$$57, 94$
go_editor
2.2k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
+
–
3
votes
2
answers
3
UGC NET CSE | June 2005 | Part 2 | Question: 15
Main() { char *str="abcde"; printf("%c",*str); printf("%c",*str++); printf("%c",*(str++)); printf("%s",str); } The output of the above $‘C’$ code will be : $\text{a a c b c d e}$ $\text{a a c c c d e}$ $\text{a a b c d e}$ None of these
Main() { char *str="abcde"; printf("%c",*str); printf("%c",*str++); printf("%c",*(str++)); printf("%s",str); }The output of the above $‘C’$ code will be :$\text{a a c...
go_editor
1.1k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
+
–
0
votes
1
answer
4
global variable
is the global variable store in code section of the process?
is the global variable store in code section of the process?
Gurdeep Saini
418
views
Gurdeep Saini
asked
Nov 3, 2018
Operating System
variable-scope
+
–
1
votes
1
answer
5
Gateforum Test Series: Compiler Design - Variable Scope
Gupta731
514
views
Gupta731
asked
Oct 19, 2018
Compiler Design
compiler-design
gateforum-test-series
variable-scope
+
–
6
votes
2
answers
6
test series
extern int i; int i=5; i=10; int main() { printf("\ni=%d",i); return 0; } output is?
extern int i;int i=5;i=10;int main(){ printf("\ni=%d",i); return 0;}output is?
parulk
1.1k
views
parulk
asked
Jan 11, 2018
Programming in C
programming-in-c
extern
variable-scope
+
–
0
votes
2
answers
7
UGC NET CSE | December 2008 | Part 2 | Question: 25
Which one of the following describes correctly a static variable? It cannot be initialized It is initialized once at the commencement of execution and cannot be changed at run time It retains its value during the life of the program None of the above
Which one of the following describes correctly a static variable?It cannot be initializedIt is initialized once at the commencement of execution and cannot be changed at ...
rishu_darkshadow
4.8k
views
rishu_darkshadow
asked
Sep 25, 2017
Programming in C
ugcnetcse-dec2008-paper2
programming-in-c
variable-scope
+
–
0
votes
4
answers
8
programming Strings
For the following program: #include<stdio.h> char *getString() { char *str = "GfG"; return str; } int main() {getString(); printf("%s", str); // Gives error, but printf("%s", getString()); works perfect. return ... does not get destroyed, wh can't we print the value using str? Why does the program give error saying that str is undeclared?
For the following program:#include<stdio.h>char *getString(){char *str = "GfG";return str; }int main(){getString();printf("%s", str); // Gives error, but printf("%s", get...
Bongbirdie
1.5k
views
Bongbirdie
asked
May 29, 2017
Programming in C
programming-in-c
strings
variable-scope
+
–
0
votes
2
answers
9
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
940
views
Bongbirdie
asked
May 28, 2017
Programming in C
programming-in-c
scoping-rule
variable-scope
+
–
16
votes
2
answers
10
GATE CSE 1987 | Question: 1-xx
For the program given below what will be printed by the write statements marked $(1)$ and $(2)$ in the program if the variables are dynamically scoped? Var x, y:interger; procedure P(n:interger); begin x := (n+2)/(n-3); end; procedure Q Var x, y:interger; begin x:=3; y:=4; P ... (1) end; begin x:=7; y:=8; Q; Write(x); __(2) end. $3, 6$ $6, 7$ $3, 7$ None of the above
For the program given below what will be printed by the write statements marked $(1)$ and $(2)$ in the program if the variables are dynamically scoped?Var x, y:interger; ...
makhdoom ghaya
3.4k
views
makhdoom ghaya
asked
Nov 8, 2016
Compiler Design
gate1987
compiler-design
variable-scope
runtime-environment
+
–
25
votes
2
answers
11
GATE CSE 1987 | Question: 1-xix
Study the following program written in a block-structured language: Var x, y:interger; procedure P(n:interger); begin x:=(n+2)/(n-3); end; procedure Q Var x, y:interger; begin x:=3; y:=4; P(y); Write(x) __(1) end; begin x:=7; y:=8; Q; Write(x); ... marked $(1)$ and $(2)$ in the program if the variables are statically scoped? $3, 6$ $6, 7$ $3, 7$ None of the above.
Study the following program written in a block-structured language:Var x, y:interger; procedure P(n:interger); begin x:=(n+2)/(n-3); end; procedure Q Var x, y:interger; b...
makhdoom ghaya
7.2k
views
makhdoom ghaya
asked
Nov 8, 2016
Compiler Design
gate1987
compiler-design
variable-scope
runtime-environment
+
–
2
votes
1
answer
12
Self Doubt
I came across few Compiler Design Doubts, Please provide your cent. $Q_1 :$ Can lexical analyser detect some/any type of errors? I think yes, because while scanning to identify tokens, it may be the cases that a string pattern doesn't match with any keyword (or) ... Left linear) $\color{navy}{A \rightarrow aA}$(Right Linear). What can be said about $\color{navy}{A \rightarrow aAb}$
I came across few Compiler Design Doubts, Please provide your cent.$Q_1 :$ Can lexical analyser detect some/any type of errors?I think yes, because while scanning to iden...
mcjoshi
1.0k
views
mcjoshi
asked
Nov 1, 2016
Compiler Design
compiler-design
lexical-analysis
variable-scope
+
–
4
votes
2
answers
13
Scope
Dexter
2.0k
views
Dexter
asked
Apr 12, 2016
Compiler Design
programming-in-c
variable-scope
made-easy-booklet
+
–
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