Webpage

$$\small{\overset{{\large{\textbf{Mark Distribution in Previous GATE}}}}{\begin{array}{|c|c|c|c|c|c|c|c|}\hline \textbf{Year}&\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}&2&2&1&2&2&1&1&1.7&2 \\\hline\textbf{2 Marks Count}&3&3&4&4&2&2&2&3&4 \\\hline\textbf{Total Marks}&8&8&9&10&6&5&\bf{5}&\bf{8}&\bf{10}\\\hline \end{array}}}$$

# Recent questions in Programming

1 vote
1
Assume that size of an integer is $32$ bit. What is the output of following ANSI C program? #include<stdio.h> struct st { int x; static int y; }; int main() { printf(%d",sizeof(struct st)); return 0; } $4$ $8$ Compiler Error Runtime Error
1 vote
2
Consider the following C declaration struct { short s[5]; union { float y; long z; }u; }t; Assume that objects of the type short, float and long occupy $2$ bytes, $4$ bytes and $8$ bytes respectively. The memory requirement for variable $t$ ignoring alignment considerations, is $22$ bytes $14$ bytes $18$ bytes $10$ bytes
1 vote
3
Output of the following program? #include<stdio.h> struct st { int x; struct st next; }; int main() { struct st temp; temp.x=10; temp.next=temp; printf("%d",temp.next,x); return 0; } Compiler Error $10$ Runtime Error Garbage Value
1 vote
4
Following is C like Pseudo code of a function that takes a number as an argument, and uses a stack S to do processing. void fun(int n) { Stack S;//Say it creates an empty stack S while(n>0) { // This line pushes the value of n%2 to stack S; Push(&S,n%2); n=n ... $n$ in reverse order. Prints binary representation of $n$. Prints the value of $\log n$. Prints the value of $\log n$ in reverse order.
1 vote
5
Bug means A logical error in a program A difficult syntax error in a program Documenting programs using an efficient documentation tool All of the above
6
If $x$ is a one dimensional array, then $^*(x+i)$ is same as $^*(\&x[i])$ $\&x[i]$ is same as $x+i-1$ $^*(x+i)$ is same as $^*x[i]$ $^*(x+i)$ is same as $^*x+i$
1 vote
7
What cannot replace ‘?’ in the following C-code to print all odd numbers less than $100$ ? for (i=1; ? ; i=i+2) printf("%d\n", i); $i\leq100$ $i\leq101$ $i<100$ $i<101$
1 vote
8
Which of the following is a valid C code to print character A' to C' ? x='A' ; switch(x) {case 'A'= printf ( "%d\n" , x); .... case 'C'= printf ( "%d\n" , x); } x='A'; switch(x) {case 'A' <= x <= 'C' : printf ( "%d\n" , x);} x='A' ; switch(x) { case 'A' : printf ( " ... break; } x='A' ; switch(x) { case 'A' =printf ( "%d\n" , x); case 'B' =printf ( "%d\n" , x); case 'C' =printf ( "%d\n" , x); }
1 vote
9
int arr[ ]={1, 2, 3, 4} int count; incr( ) {return ++count;} main( ) { arr[count++]=incr( ); printf(“arr[count]=%d\n”, arr[count]); } The value printed by the above program is : $1$ $2$ $3$ $4$
1 vote
10
The declaration “unsigned u” indicates : u is an unsigned character u is an unsigned integer u is a character u is a string
11
What is the output of the following $C$-program main() { printf("%d %d %d",size of (3.14f), size of (3.14), size of (3.141)); } 4 4 4 4 8 10 8 4 8 8 8 8
1 vote
12
After $3$ calls of the $c$ function bug ( ) below, the values of $i$ and $j$ will be : int j = 1; bug () { static int i = 0; int j = 0; i++; j++; return (i); } $i = 0, j = 0$ $i = 3, j = 3$ $i = 3, j = 0$ $i = 3, j = 1$
1 vote
13
Find the output of the following $“C”$ code : Main() { int x=20, y=35; x=y++ + x++; y=++y + ++x; printf (“%d, %d\n”, x, y); } $55, 93$ $53, 97$ $56, 95$ $57, 94$
14
Main() { char *str="abcde"; printf("%c",*str); printf("%c",*str++); printf("%c",*(str++)); printf("%s",str); } The output of the above $‘C’$ code will be : $\text{a a c b c d e}$ $\text{a a c c c d e}$ $\text{a a b c d e}$ None of these
1 vote
15
Consider the following statements, Int i=4, j=3, k=0; k=++i - --j + i++---j +j++; What will be the values of $i, j$ and $k$ after the statement. $7,2,8$ $5,2,10$ $6,2,8$ $4,2,8$
1 vote
16
What is the value of the arithmetic expression (Written in C) $2*3/4-3/4*2$ $0$ $1$ $1.5$ None of these
1 vote
17
A function object : is an instance of a class for which operator ( ) is a member function is an instance of a class for which operator → is a member function is a pointer to any function is a member function of a class
Consider the following C functions. int fun1(int n) { static int i= 0; if (n > 0) { ++i; fun1(n-1); } return (i); } int fun2(int n) { static int i= 0; if (n>0) { i = i+ fun1 (n) ; fun2(n-1) ; } return (i); } The return value of $\text{fun}2 (5)$ is _________