Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Programming:
Recent questions tagged programming
15
votes
2
answers
901
GATE CSE 2006 | Question: 56, ISRO2009-58
Consider the following code written in a pass-by-reference language like FORTRAN and these statements about the code. subroutine swap(ix,iy) it = ix L1 : ix = iy L2 : iy = it end ia = 3 ib = 8 call swap (ia, ib+5) print *, ia, ib end ... : The program will print 13 and -2 Exactly the following set of statement(s) is correct: S1 and S2 S1 and S4 S3 S1 and S5
Consider the following code written in a pass-by-reference language like FORTRAN and these statements about the code. subroutine swap(ix,iy) it = ix L1 : ix = iy L2 : iy ...
Rucha Shelke
6.8k
views
Rucha Shelke
asked
Sep 26, 2014
Programming in C
gatecse-2006
programming
parameter-passing
normal
out-of-syllabus-now
isro2009
+
–
62
votes
5
answers
902
GATE CSE 2014 Set 1 | Question: 10
Consider the following program in C language: #include <stdio.h> main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); } Which one of the following statements is TRUE? Compilation fails. Execution ... $5$ more than the address of variable $i$. On execution, the value printed is $5$ more than the integer value entered.
Consider the following program in C language:#include <stdio.h main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); }Which one of the following statements is...
go_editor
17.6k
views
go_editor
asked
Sep 26, 2014
Programming in C
gatecse-2014-set1
programming
programming-in-c
easy
pointers
+
–
28
votes
1
answer
903
GATE CSE 1998 | Question: 2.15
Faster access to non-local variables is achieved using an array of pointers to activation records called a stack heap display activation tree
Faster access to non-local variables is achieved using an array of pointers to activation records called a stackheapdisplayactivation tree
Kathleen
8.9k
views
Kathleen
asked
Sep 25, 2014
Compiler Design
gate1998
programming
compiler-design
normal
runtime-environment
+
–
25
votes
3
answers
904
GATE CSE 1998 | Question: 2.13
What is the result of the following program? program side-effect (input, output); var x, result: integer; function f (var x:integer):integer; begin x:x+1;f:=x; end begin x:=5; result:=f(x)*f(x); writeln(result); end $5$ $25$ $36$ $42$
What is the result of the following program?program side-effect (input, output); var x, result: integer; function f (var x:integer):integer; begin x:x+1;f:=x; end begin x...
Kathleen
7.2k
views
Kathleen
asked
Sep 25, 2014
Programming in C
gate1998
programming
normal
identify-function
+
–
6
votes
2
answers
905
GATE CSE 1999 | Question: 2.13
Consider the following program in a language that has dynamic scooping: var x: real; procedure show: begin print(x);end; procedure small; var x: real; begin x: = 0.125; show; end; begin x:=0.25 show; small end. Then the output of the program is: 0.125 0.125 0.25 0.25 0.25 0.125 0.125 0.25
Consider the following program in a language that has dynamic scooping:var x: real; procedure show: begin print(x);end; procedure small; var x: real; begin x: = 0.125; sh...
Kathleen
5.8k
views
Kathleen
asked
Sep 23, 2014
Programming in C
gate1999
programming
variable-binding
normal
out-of-syllabus-now
+
–
31
votes
5
answers
906
GATE CSE 1999 | Question: 2.5
Given the programming constructs assignment for loops where the loop parameter cannot be changed within the loop if-then-else forward go to arbitrary go to non-recursive procedure call recursive procedure/function call repeat loop, which constructs will you not include in a programming language ... $\text{(vi), (vii), (viii)}$ $\text{(iii), (vii), (viii)}$
Given the programming constructsassignmentfor loops where the loop parameter cannot be changed within the loopif-then-elseforward go toarbitrary go tonon-recursive proced...
Kathleen
12.7k
views
Kathleen
asked
Sep 23, 2014
Programming in C
gate1999
programming
normal
programming-constructs
+
–
51
votes
8
answers
907
GATE CSE 2005 | Question: 32
Consider the following C program: double foo (double); /* Line 1 */ int main() { double da, db; //input da db = foo(da); } double foo (double a) { return a; } The above code compiled without any error ... or error some compiler-warnings not leading to unintended results some compiler-warnings due to type-mismatch eventually leading to unintended results compiler errors
Consider the following C program:double foo (double); /* Line 1 */ int main() { double da, db; //input da db = foo(da); } double foo (double a) { return a; }The above cod...
Kathleen
16.5k
views
Kathleen
asked
Sep 22, 2014
Programming in C
gatecse-2005
programming
programming-in-c
compiler-design
easy
+
–
11
votes
4
answers
908
GATE CSE 2005 | Question: 4
Which one of the following are essential features of an object-oriented programming language? Abstraction and encapsulation Strictly-typedness Type-safe property coupled with sub-type rule Polymorphism in the presence of inheritance I and II only I and IV only I, II and IV only I, III and IV only
Which one of the following are essential features of an object-oriented programming language?Abstraction and encapsulationStrictly-typednessType-safe property coupled wit...
Kathleen
6.0k
views
Kathleen
asked
Sep 22, 2014
Object Oriented Programming
gatecse-2005
programming
normal
object-oriented-programming
non-gate
+
–
13
votes
3
answers
909
GATE CSE 2005 | Question: 3, UGCNET-June2012-III: 15
A common property of logic programming languages and functional languages is: both are procedural languages both are based on $\lambda$-calculus both are declarative both use Horn-clauses
A common property of logic programming languages and functional languages is:both are procedural languages both are based on $\lambda$-calculusboth are declarativeboth us...
Kathleen
12.5k
views
Kathleen
asked
Sep 22, 2014
Programming in C
gatecse-2005
programming
normal
ugcnetcse-june2012-paper3
programming-paradigms
non-gate
+
–
38
votes
5
answers
910
GATE CSE 2005 | Question: 1, ISRO2017-55
What does the following C-statement declare? int (*f) (int * ); A function that takes an integer pointer as argument and returns an integer A function that takes an integer as argument and returns an integer pointer A pointer ... pointer as argument and returns an integer A function that takes an integer pointer as argument and returns a function pointer
What does the following C-statement declare?int (*f) (int * );A function that takes an integer pointer as argument and returns an integerA function that takes an integer ...
Kathleen
20.9k
views
Kathleen
asked
Sep 22, 2014
Programming in C
gatecse-2005
programming
programming-in-c
pointers
easy
isro2017
+
–
26
votes
1
answer
911
GATE CSE 2007 | Question: 42
Consider the following C function: int f(int n) { static int r = 0; if (n <= 0) return 1; if (n > 3) { r = n; return f(n-2) + 2; } return f(n-1) + r; } What is the value of $f(5)$? $5$ $7$ $9$ $18$
Consider the following C function:int f(int n) { static int r = 0; if (n <= 0) return 1; if (n 3) { r = n; return f(n-2) + 2; } return f(n-1) + r; }What is the value of ...
Kathleen
10.5k
views
Kathleen
asked
Sep 21, 2014
Programming in C
gatecse-2007
programming
recursion
normal
+
–
26
votes
5
answers
912
GATE CSE 2004 | Question: 90
Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2. ... $P-3\quad Q-4 \quad R-1\quad S-2$ $P-3\quad Q-4\quad R-2\quad S-1$
Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2.$$\begin{array}{|ll|ll|}\hline \rlap{\textbf{Group 1}} & & \rlap{...
Kathleen
7.1k
views
Kathleen
asked
Sep 18, 2014
Programming in C
gatecse-2004
programming
normal
programming-paradigms
match-the-following
+
–
34
votes
2
answers
913
GATE CSE 2004 | Question: 33
Consider the following C program segment: char p[20]; int i; char* s = "string"; int length = strlen(s); for(i = 0; i < length; i++) p[i] = s[length-i]; printf("%s", p); The output of the program is: gnirts string gnirt no output is printed
Consider the following C program segment:char p[20]; int i; char* s = "string"; int length = strlen(s); for(i = 0; i < length; i++) p[i] = s[length-i]; printf("%s", p);Th...
Kathleen
13.2k
views
Kathleen
asked
Sep 18, 2014
Programming in C
gatecse-2004
programming
programming-in-c
easy
+
–
32
votes
5
answers
914
GATE CSE 2004 | Question: 32
Consider the following program fragment for reversing the digits in a given integer to obtain a new integer. Let $n = d_1\, d_2\, \ldots\, d_m$. int n, rev; rev = 0; while(n > 0) { rev = rev * 10 + n%10; n = n/10; } The loop invariant condition at the end ... $n=d_1\, d_2 \,\ldots\, d_m \qquad \mathbf{or} \qquad \text{rev} =d_m \,\ldots\, d_2\, d_1$
Consider the following program fragment for reversing the digits in a given integer to obtain a new integer.Let $n = d_1\, d_2\, \ldots\, d_m$.int n, rev; rev = 0; while(...
Kathleen
12.3k
views
Kathleen
asked
Sep 18, 2014
Programming in C
gatecse-2004
programming
loop-invariants
normal
+
–
28
votes
3
answers
915
GATE CSE 2004 | Question: 31, ISRO2008-40
Consider the following C function: int f(int n) { static int i = 1; if(n >= 5) return n; n = n+i; i++; return f(n); } The value returned by $f(1)$ is: $5$ $6$ $7$ $8$
Consider the following C function:int f(int n) { static int i = 1; if(n >= 5) return n; n = n+i; i++; return f(n); }The value returned by $f(1)$ is:$5$$6$$7$$8$
Kathleen
14.7k
views
Kathleen
asked
Sep 18, 2014
Programming in C
gatecse-2004
programming
programming-in-c
recursion
easy
isro2008
+
–
24
votes
2
answers
916
GATE CSE 2004 | Question: 1
The goal of structured programming is to: have well indented programs be able to infer the flow of control from the compiled code be able to infer the flow of control from the program text avoid the use of GOTO statements
The goal of structured programming is to:have well indented programsbe able to infer the flow of control from the compiled codebe able to infer the flow of control from t...
Kathleen
9.1k
views
Kathleen
asked
Sep 18, 2014
Programming in C
gatecse-2004
programming
easy
programming-paradigms
+
–
40
votes
5
answers
917
GATE CSE 2003 | Question: 89
Consider the C program shown below: #include<stdio.h> #define print(x) printf("%d", x) int x; void Q(int z) { z+=x; print(z); } void P(int *y) { int x = *y + 2; Q(x); *y = x - 1; print(x); } main(void) { x = 5; P(&x); print(x); } The output of this program is: $12 \ 7 \ 6$ $22 \ 12 \ 11$ $14 \ 6 \ 6$ $7 \ 6 \ 6$
Consider the C program shown below:#include<stdio.h #define print(x) printf("%d", x) int x; void Q(int z) { z+=x; print(z); } void P(int *y) { int x = *y + 2; Q(x); *y = ...
Kathleen
12.6k
views
Kathleen
asked
Sep 17, 2014
Programming in C
gatecse-2003
programming
programming-in-c
normal
pointers
+
–
2
votes
2
answers
918
GATE CSE 2003 | Question: 75
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. Class P { Class Q subclass of P { void f(int ... P. The output produced by executing the above program fragment will be 1 2 1 2 1 1 2 1 2 2 2 2
Consider the following class definitions in a hypothetical Object Oriented language that supports inheritance and uses dynamic binding. The language should not be assumed...
Kathleen
5.6k
views
Kathleen
asked
Sep 17, 2014
Programming in C
gatecse-2003
programming
variable-binding
normal
out-of-syllabus-now
+
–
5
votes
0
answers
919
GATE CSE 2003 | Question: 71
Consider the following logic program P $\begin{align*} A(x) &\gets B(x,y), C(y) \\ &\gets B(x,x) \end{align*}$ ... $(\forall x) [(\forall y) [B(x,y) \land C(y)] \Rightarrow A(x)] \land (\exists x)[B(x,x)]$
Consider the following logic program P$\begin{align*} A(x) &\gets B(x,y), C(y) \\ &\gets B(x,x) \end{align*}$Which of the following first order sentences is equivalent to...
Kathleen
3.9k
views
Kathleen
asked
Sep 17, 2014
Programming in C
gatecse-2003
programming
logic-programming
out-of-syllabus-now
+
–
39
votes
4
answers
920
GATE CSE 2003 | Question: 24
Which of the following statements is FALSE? In statically typed languages, each variable in a program has a fixed type In un-typed languages, values do not have any types In dynamically typed languages, variables have no types In all statically typed languages, each variable in a program is associated with values of only a single type during the execution of the program
Which of the following statements is FALSE?In statically typed languages, each variable in a program has a fixed typeIn un-typed languages, values do not have any typesIn...
Kathleen
9.2k
views
Kathleen
asked
Sep 16, 2014
Programming in C
gatecse-2003
programming
normal
type-checking
+
–
72
votes
4
answers
921
GATE CSE 2003 | Question: 2
Assume the following C variable declaration: int *A[10], B[10][10]; Of the following expressions: $A[2]$ $A[2][3]$ $B[1]$ $B[2][3]$ which will not give compile-time errors if used as left hand sides of assignment statements in a C program? I, II, and IV only II, III, and IV only II and IV only IV only
Assume the following C variable declaration:int *A[10], B[10][10];Of the following expressions:$A $$A [3]$$B $$B [3]$which will not give compile-time errors if used as le...
Kathleen
30.3k
views
Kathleen
asked
Sep 16, 2014
Programming in C
gatecse-2003
programming
programming-in-c
easy
pointers
+
–
24
votes
2
answers
922
GATE CSE 2002 | Question: 11
The following recursive function in C is a solution to the Towers of Hanoi problem. void move(int n, char A, char B, char C) { if (......................) { move (.............................); printf("Move disk %d from pole %c to pole %c\n", n, A, C); move (.....................); } } Fill in the dotted parts of the solution.
The following recursive function in C is a solution to the Towers of Hanoi problem.void move(int n, char A, char B, char C) { if (......................) { move (...........
Kathleen
3.3k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
recursion
descriptive
+
–
35
votes
3
answers
923
GATE CSE 2002 | Question: 2.18
The C language is: A context free language A context sensitive language A regular language Parsable fully only by a Turing machine
The C language is:A context free languageA context sensitive languageA regular languageParsable fully only by a Turing machine
Kathleen
10.4k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
programming-in-c
normal
+
–
39
votes
4
answers
924
GATE CSE 2002 | Question: 2.8
Consider the following declaration of a two-dimensional array in C: char $a[100][100]$; Assuming that the main memory is byte-addressable and that the array is stored starting from memory address $0$, the address of $a [40][50]$ is: $4040$ $4050$ $5040$ $5050$
Consider the following declaration of a two-dimensional array in C:char $a[100][100]$;Assuming that the main memory is byte-addressable and that the array is stored start...
Kathleen
28.2k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming-in-c
programming
easy
+
–
13
votes
2
answers
925
GATE CSE 2002 | Question: 1.18
The results returned by function under value-result and reference parameter passing conventions Do not differ Differ in the presence of loops Differ in all cases May differ in the presence of exception
The results returned by function under value-result and reference parameter passing conventionsDo not differDiffer in the presence of loopsDiffer in all casesMay differ i...
Kathleen
8.4k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
parameter-passing
normal
out-of-syllabus-now
+
–
40
votes
1
answer
926
GATE CSE 2002 | Question: 1.17
In the C language: At most one activation record exists between the current activation record and the activation record for the main The number of activation records between the current activation record and the activation records from the main ... record for the recursive function to be saved in a different stack before the recursive function can be called.
In the C language:At most one activation record exists between the current activation record and the activation record for the mainThe number of activation records betwee...
Kathleen
10.3k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
programming-in-c
easy
descriptive
+
–
31
votes
2
answers
927
GATE CSE 2001 | Question: 13
Consider the following C program: void abc(char*s) { if(s[0]=='\0')return; abc(s+1); abc(s+1); printf("%c",s[0]); } main() { abc("123"); } What will be the output of the program? If $abc(s)$ is called ... string $s$ of length $n$ characters (not counting the null ('\0') character), how many characters will be printed by $abc(s)$?
Consider the following C program:void abc(char*s) { if(s[0]=='\0')return; abc(s+1); abc(s+1); printf("%c",s[0]); } main() { abc("123"); }What will be the output of the pr...
Kathleen
11.2k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2001
programming
recursion
normal
descriptive
+
–
11
votes
2
answers
928
GATE CSE 2001 | Question: 2.19
Consider the following program Program P2 var n : int; procedure W(var x : int) begin x = x + 1; print x; end procedure D begin var n : int; n = 3; W(n); end begin \\begin P2 n=10; D; end If the language has dynamic scooping and parameters are passed by reference, what will be printed by the program? 10 11 3 None of the above
Consider the following programProgram P2 var n : int; procedure W(var x : int) begin x = x + 1; print x; end procedure D begin var n : int; n = 3; W(n); end begin \\begin...
Kathleen
7.4k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2001
programming
parameter-passing
normal
out-of-syllabus-now
+
–
62
votes
3
answers
929
GATE CSE 2001 | Question: 2.18
Consider the following three C functions: $[P1]$ int *g(void) { int x = 10; return (&x); } $[P2]$ int *g(void) { int *px; *px = 10; return px; } $[P3]$ int *g(void) { int *px; px = (int*) malloc (sizeof(int)); *px = 10; ... of the above three functions are likely to cause problems with pointers? Only $P3$ Only $P1$ and $P3$ Only $P1$ and $P2$ $P1, P2$ and $P3$
Consider the following three C functions:$[P1]$ int *g(void) { int x = 10; return (&x); }$[P2]$ int *g(void) { int *px; *px = 10; return px; }$[P3]$ int *g(void) { int *p...
Kathleen
24.5k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2001
programming
programming-in-c
normal
pointers
+
–
6
votes
2
answers
930
GATE CSE 2000 | Question: 18
Consider the following program is pseudo-Pascal syntax program main; var x: integer; procedure Q (z: integer); begin z := z+x; writeln(z); end; procedure P (y: integer); var x: integer; begin x := y+2; Q(x); writeln(x); ... is call-by-value and the scope rule is static scoping? the parameter passing mechanism is call-by-reference and the scope rule is dynamic scoping?
Consider the following program is pseudo-Pascal syntaxprogram main; var x: integer; procedure Q (z: integer); begin z := z+x; writeln(z); end; procedure P (y: integer);...
Kathleen
3.1k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2000
programming
parameter-passing
normal
out-of-syllabus-now
descriptive
+
–
Page:
« prev
1
...
26
27
28
29
30
31
32
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register