Webpage

$$\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

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$
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
1 vote
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
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
1 vote
5
If initialization is a part of declaration of a structure, then storage class can be automatic register static anything
1 vote
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$
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
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$
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
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$
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
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
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
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$
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
1 vote
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";
1 vote
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)$
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.