search
Log In

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{2021-1}&\textbf{2021-2}&\textbf{2020}&\textbf{2019}&\textbf{2018}&\textbf{2017-1}&\textbf{2017-2}&\textbf{2016-1}&\textbf{2016-2}&\textbf{Minimum}&\textbf{Average}&\textbf{Maximum}
\\\hline\textbf{1 Mark Count}&0&2&1&2&2&1&2&2&1&0&1.4&2
\\\hline\textbf{2 Marks Count}&2&2&2&3&3&4&4&2&2&2&2.6&4
\\\hline\textbf{Total Marks}&4&6&5&8&8&9&10&6&5&\bf{4}&\bf{6.7}&\bf{10}\\\hline
\end{array}}}$$

Recent questions in Programming

2 votes
4 answers
1
Consider the following $\text{ANSI C}$ program. #include <stdio.h> int main() { int arr[4][5]; int i, j; for (i=0; i<4; i++) ​​​​​​{ for (j=0; j<5; j++) { arr[i][j] = 10 * i + j; } } printf(“%d”, *(arr[1]+9)); return 0; } What is the output of the above program? $14$ $20$ $24$ $30$
asked Feb 18 in Programming Arjun 1.1k views
0 votes
1 answer
2
Consider the following $\text{ANSI C}$ program: #include <stdio.h> #include <stdlib.h> struct Node{ int value; struct Node *next;}; int main( ) { struct Node *boxE, *head, *boxN; int index=0; boxE=head= (struct Node *) malloc(sizeof(struct Node)) ... $\textsf{return}$ which will be reported as an error by the compiler It dereferences an uninitialized pointer that may result in a run-time error
asked Feb 18 in Programming Arjun 594 views
1 vote
2 answers
3
Consider the following$\text{ ANSI C}$ program. #include <stdio.h> int main() { int i, j, count; count=0; i=0; for (j=-3; j<=3; j++) { if (( j >= 0) && (i++)) count = count + j; } count = count + ... will compile successfully and output $10$ when executed The program will compile successfully and output $8$ when executed The program will compile successfully and output $13$ when executed
asked Feb 18 in Programming Arjun 493 views
3 votes
1 answer
4
An external variable is globally accessible by all functions has a declaration “extern” associated with it when declared within a function will be initialized to $0$ if not initialized all of these
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 553 views
1 vote
1 answer
5
If initialization is a part of declaration of a structure, then storage class can be automatic register static anything
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 293 views
1 vote
1 answer
6
For $x$ and $y$ are variables as declared below $\textit{double }x=0.005, \: y = – 0.01;$ What is the value of $\text{ceil }(x+y)$, where $\text{ceil }$ is a function to compute ceiling of a number? $1$ $0$ $0.005$ $0.5$
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 236 views
0 votes
3 answers
7
In C programming language, if the first and the second operands of operator $+$ are of types int and float, respectively, the result will be of type int float char long int
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 247 views
0 votes
1 answer
8
What will be the value of $x$ and $y$ after execution of the following statement(C language) n = 5; x = n++; y = -x; $5,-4$ $6,-5$ $6,-6$ $5,-5$
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 179 views
0 votes
1 answer
9
The question is based on the following program fragment. f(intY[10],int x){ int u,j,k; i=0;j=9; do{ k=(i+j)/2; if(Y[k] < x) i=k; else j=k; } while((Y[k]!=x) && (i<j)); if (Y[k]==x) printf( x is in the array. ); else printf( x is not in the array. ); } On which of the following contents of ... $x>2$ $Y$ is $[2\;4\;6\;8\;10\;12\;14\;16\;18\;20]$ and $2<x<20$ and $'x'$ is even
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 458 views
0 votes
2 answers
10
What will be the output of following? main() { Static int a = 3; Printf(“%d”,a--); If(a) main(); } $3$ $3\;2\;1$ $3\;3\;3$ Program will fall in continuous loop and print $3$
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 334 views
0 votes
0 answers
11
The following program fragment prints int i = 5; do { putchar(i+100); printf(“%d”, i--;) } while(i); i5h4g3f2el 14h3g2f1e0 An error message None of the above
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 224 views
0 votes
0 answers
12
Consider the following declaration. int a, *b = &a, **c = &b; a = 4; **c = 5; If the statement b = (int *)**c Is appended to the above program fragment then Value of $b$ becomes $5$ Value of $b$ will be the address of $c$ Value of $b$ is unaffected None of these
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 241 views
2 votes
1 answer
13
The following program fragment prints int i = 5; do { putchar(i+100); printf(“%d”, i--;) } while(i); i5h4g3f2el 14h3g2f1e0 An error message None of the above
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 209 views
0 votes
3 answers
14
What will be the output of following? main() { Static int a = 3; Printf(“%d”,a--); If(a) main(); } $3$ $3\;2\;1$ $3\;3\;3$ Program will fall in continuous loop and print $3$
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 235 views
0 votes
0 answers
15
The question is based on the following program fragment. f(intY[10],int x){ int u,j,k; i=0;j=9; do{ k=(i+j)/2; if(Y[k] < x) i=k; else j=k; } while(Y[k]!=x) && (i<j)); if (Y[k]==x) printf( x is in the array. ); else printf( x is not in the array. ); } On which of the following contents of ... $x>2$ $Y$ is $[2\;4\;6\;8\;10\;12\;14\;16\;18\;20]$ and $2<x<20$ and $'x'$ is even
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 217 views
1 vote
2 answers
16
Which of the following is illegal declaration in $C$ language? char*str ="Raj is a Research scholar"; char str[25] ="Raj is a Research scholar"; char str[40] ="Raj is a Research scholar"; char[]str ="Raj is a Research scholar";
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 519 views
1 vote
3 answers
17
What is the correct way to round off $x$, $a$ $\text{float}$ to an $\text{int}$ value? $y=(\text{int})(x+0.5)$ $y=\text{int} (x+0.5)$ $y=(\text{int}) x+0.5$ $y=(\text{int})(\text{int})x+0.5)$
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 399 views
2 votes
6 answers
18
What error would the following function give on compilation? f(int a, int b) { int a; a=20; return a; } Missing parenthesis is $\textit{return}$ statement. Function should be defined as $\text{int f(int a, int b)}$ Redeclaration of $a$. None of these.
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 888 views
2 votes
1 answer
19
1 vote
1 answer
20
Output of the following loop is for(putchar('c');putchar ('a');putchar('r')) putchar('t'); a syntax error. cartrt. catrat. catratratratrat...
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 425 views
...