1
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6
The following program fragment is written in a programming language that allows global
variables and does not allow nested declarations of functions.
global int i = 100, j = 5;
void P(x) {
int i = 10;
print(x + 10);
i = 200;
j = 20;
print (x);
}
main() {
P(i + j);
}
If the programming language uses dynamic scoping and call by name parameter
passing mechanism, the values printed by the above program are2
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
Which of the following statements is FALSE?
3
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6
Consider the following class definitions in a hypothetical Object Oriented
language that supports inheritance and uses dynamic binding. The language
should not be assumed to be either Java or C++, though the syntax is similar.
Px = new Q();
Qy = new Q();
Pz = new Q();
x.f(1); ((P)y).f(1); z.f(1);
Here ((P)y) denotes a typecast of y to P. The output produced by executing the above program fragment will be
Class P {
void f(int i) {
print(i);
}
}
Class Q subclass of P {
void f(int i) {
print(2*i);
}
}
Now consider the following program fragment:
Px = new Q();
Qy = new Q();
Pz = new Q();
x.f(1); ((P)y).f(1); z.f(1);
Here ((P)y) denotes a typecast of y to P. The output produced by executing the above program fragment will be
4
GATE CSE 2003
MCQ (Single Correct Answer)
+1
-0.3
Assume the following C variable declaration
I. A[2]
II. A[2] [3]
III. B[1]
IV. B[2] [3]
Which will not give compile-time errors if used as left hand sides of assignment statements in a C program?
int * A[10], B[10][10];
Of the following expressionsI. A[2]
II. A[2] [3]
III. B[1]
IV. B[2] [3]
Which will not give compile-time errors if used as left hand sides of assignment statements in a C program?
Paper analysis
Total Questions
Algorithms
9
Compiler Design
9
Computer Networks
5
Computer Organization
2
Data Structures
4
Database Management System
5
Digital Logic
5
Discrete Mathematics
11
Operating Systems
8
Programming Languages
7
Theory of Computation
8
More papers of GATE CSE
GATE CSE 2024 Set 2
GATE CSE 2024 Set 1
GATE CSE 2023
GATE CSE 2022
GATE CSE 2021 Set 2
GATE CSE 2021 Set 1
GATE CSE 2020
GATE CSE 2019
GATE CSE 2018
GATE CSE 2017 Set 1
GATE CSE 2017 Set 2
GATE CSE 2016 Set 1
GATE CSE 2016 Set 2
GATE CSE 2015 Set 1
GATE CSE 2015 Set 3
GATE CSE 2015 Set 2
GATE CSE 2014 Set 3
GATE CSE 2014 Set 2
GATE CSE 2014 Set 1
GATE CSE 2013
GATE CSE 2012
GATE CSE 2011
GATE CSE 2010
GATE CSE 2009
GATE CSE 2008
GATE CSE 2007
GATE CSE 2006
GATE CSE 2005
GATE CSE 2004
GATE CSE 2003
GATE CSE 2002
GATE CSE 2001
GATE CSE 2000
GATE CSE 1999
GATE CSE 1998
GATE CSE 1997
GATE CSE 1996
GATE CSE 1995
GATE CSE 1994
GATE CSE 1993
GATE CSE 1992
GATE CSE 1991
GATE CSE 1990
GATE CSE 1989
GATE CSE 1988
GATE CSE 1987
GATE CSE
Papers
2023
2022
2020
2019
2018
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997
1996
1995
1994
1993
1992
1991
1990
1989
1988
1987