Webpage

Programming in C. Recursion.

$$\scriptsize{\overset{{\large{\textbf{Mark Distribution in Previous GATE}}}}{\begin{array}{|c|c|c|c|c|c|c|c|}\hline
\textbf{Year} &\textbf{2024-1}&\textbf{2024-2}&\textbf{2023}& \textbf{2022}&\textbf{2021-1}&\textbf{2021-2}&\textbf{Minimum}&\textbf{Average}&\textbf{Maximum}
\\\hline\textbf{1 Mark Count} & 2&2&1&1 &0&2&0&1.33&2
\\\hline\textbf{2 Marks Count} &1&1&0& 2&2&2&0&1.33&2
\\\hline\textbf{Total Marks} &4&4&1& 5&4&6&\bf{1}&\bf{4}&\bf{6}\\\hline
\end{array}}}$$

Recent questions in Programming

#3801
9.5k
views
4 answers
39 votes
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 ... associated with values of only a single type during the execution of the program
#3802
31.0k
views
4 answers
73 votes
Assume the following C variable declaration:int *A[10], B[10][10];Of the following expressions:$A[2]$A[2][3]$B[1]$ ... in a C program?I, II, and IV onlyII, III, and IV onlyII and IV onlyIV only
#3803
3.4k
views
2 answers
24 votes
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 (... ... (.....................); } }Fill in the dotted parts of the solution.
#3804
10.7k
views
3 answers
35 votes
The C language is:A context free languageA context sensitive languageA regular languageParsable fully only by a Turing machine
#3805
28.6k
views
4 answers
39 votes
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 ... $, the address of $a [40][50]$ is:$4040$4050$5040$5050$
#3806
8.5k
views
2 answers
13 votes
The results returned by function under value-result and reference parameter passing conventionsDo not differDiffer in the presence of loopsDiffer in all casesMay differ in the presence of exception
#3807
10.5k
views
1 answers
41 votes
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 ... saved in a different stack before the recursive function can be called.
#3808
11.5k
views
2 answers
31 votes
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 ... (not counting the null ('\0') character), how many characters will be printed by $abc(s)$?
#3809
7.6k
views
2 answers
11 votes
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; ... parameters are passed by reference, what will be printed by the program?10113None of the above
#3810
25.3k
views
3 answers
63 votes
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]$ ... $Only $P1$ and $P3$Only $P1$ and $P2$P1, P2$ and $P3$
#3811
12.9k
views
4 answers
27 votes
What is printed by the print statements in the program $P1$ assuming call by reference parameter passing?Program P1() { x = 10; y = 3; func1(y,x,x); print x; print y; } ... + z }$\text{10, 3}$\text{31, 3}$\text{27, 7}$None of the above
#3812
3.1k
views
2 answers
6 votes
Consider the following program is pseudo-Pascal syntaxprogram main; var x: integer; procedure Q (z: integer); begin z := z+x; writeln(z); end; ... the parameter passing mechanism is call-by-reference and the scope rule is dynamic scoping?
#3813
5.0k
views
3 answers
27 votes
A recursive program to compute Fibonacci numbers is shown below. Assume you are also given an array $f [ 0\ldots m]$ ... book.What is the time complexity of the resulting program when computing $fib(n)?$
#3814
15.5k
views
2 answers
30 votes
The value of $j$ at the end of the execution of the following C program:int incr (int i) { static int count = 0; count = count + i; return (count); } main () { int i, j; for (i = 0; i <= 4; i++) j = incr (i); }is:$10$4$6$7$
#3815
21.3k
views
4 answers
51 votes
Consider the following C declaration:struct { short x[5]; union { float y; long z; } u; )t;Assume that the objects of the type short, float and long ... $t$, ignoring alignment consideration, is:$22$ bytes$14$ bytes$18$ bytes$10$ bytes
#3816
25.3k
views
9 answers
45 votes
Aliasing in the context of programming languages refers tomultiple variables having the same memory locationmultiple variables having the same valuemultiple variables having the same identifiermultiple uses of the same variable
#3817
12.3k
views
3 answers
52 votes
The most appropriate matching for the following pairs ... \ Y - 2 \ \ Z - 1$X - 3 \ \ Y - 1 \ \ Z - 2$
#3818
19.5k
views
5 answers
41 votes
The following C declarations:struct node { int i: float j; }; struct node *s[10];define s to be:An array, each element of which is a pointer to a ... an array of $10$ elementsAn array, each element of which is a structure of type node
#3819
450
views
0 answers
0 votes
#3820
1.3k
views
1 answers
1 votes
What type of parameter passing mechanism (call-by-value, call-by-reference, call-by-name, or-by-value result) is the following sequence of actions trying to implement for a ... .Execute the body of P using z for A[i]Set A[i] to z.