search
Log In

Webpage

Programming in C. Recursion.

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

2 votes
5 answers
1
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 in Programming Lakshman Patel RJIT 411 views
2 votes
1 answer
2
Prior to using a pointer variable it should be declared. initialized. both declared and initialized. none of these.
asked Mar 31 in Programming Lakshman Patel RJIT 232 views
2 votes
1 answer
3
2 votes
2 answers
4
What is the meaning of following declaration? int(*p[7])(); $p$ is pointer to function $p$ is pointer to such function which return type is array $p$ is array of pointer to function $p$ is pointer to array of function
asked Mar 31 in Programming Lakshman Patel RJIT 125 views
2 votes
1 answer
5
1 vote
1 answer
6
1 vote
2 answers
7
1 vote
1 answer
8
What will be output if you will compile and execute the following C code? void main(){ char c=125; c=c+10; printf("%d",c); } $135$ $115$ $-121$ $-8$
asked Mar 31 in Programming Lakshman Patel RJIT 115 views
1 vote
4 answers
9
What will be output if you will compile and execute the following C code? void main() { printf("%d",sizeof(5.2)); } $4$ $8$ $2$ $16$
asked Mar 31 in Programming Lakshman Patel RJIT 141 views
1 vote
1 answer
10
The following program is to be tested for statement coverage: begin if(a==b){S1;exit;} else if (c==d){S2;} else{S3;exit;} S4; end The test cases $T1,T2,T3$ and $T4$ given below are expressed in terms of the properties satisfied by the values of variables $a,b,c$ ... of the test suites given below ensures coverage of statements $S1,S2,S3$ and $S4$? $T_1,T_2,T_3$ $T_2,T_4$ $T_3,T_4$ $T_1,T_2,T_4$
asked Mar 30 in Programming Lakshman Patel RJIT 74 views
1 vote
2 answers
11
Output of following program #include<stdio.h> int main() { int i=5; printf("%d %d %d", i++,i++,i++); return 0; } $7\:6\:5$ $5\:6\:7$ $7\:7\:7$ Compiler Dependent
asked Mar 30 in Programming Lakshman Patel RJIT 98 views
1 vote
1 answer
12
Output of following program? #include<stdio.h> void dynamic(int s,...) { printf("%d",s); } int main() { dynamic(2,4,6,8); dynamic(3,6,9); return 0; } $2\:3$ Compiler Error $4\:3$ $3\:2$
asked Mar 30 in Programming Lakshman Patel RJIT 79 views
1 vote
1 answer
13
Assume that float takes $4$ bytes, predict the output of following program. #include<stdio.h> int main() { float arr[5]={12.5,10.0,13.5,90.5,0.5}; float *ptr1=&arr[0]; float *ptr2=ptr1+3; printf("%f",*ptr2); printf("%d",ptr2-ptr1); return 0; } $90.500000\:\:3$ $90.500000\:\:12$ $10.000000\:\:12$ $0.500000\:\:3$
asked Mar 30 in Programming Lakshman Patel RJIT 70 views
1 vote
1 answer
14
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
asked Mar 30 in Programming Lakshman Patel RJIT 76 views
1 vote
1 answer
15
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
asked Mar 30 in Programming Lakshman Patel RJIT 57 views
1 vote
1 answer
16
#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
asked Mar 30 in Programming Lakshman Patel RJIT 95 views
1 vote
1 answer
17
What does the following function do for a given Linked List with first node as head? void fun1(struct node* head) { if(head==NULL) return; fun1(head->next); printf("%d",head->data); } Prints all nodes of linked lists Prints all nodes of linked list in reverse order Prints alternate nodes of Linked List Prints alternate nodes in reverse order
asked Mar 30 in Programming Lakshman Patel RJIT 114 views
1 vote
1 answer
18
Let $A$ be a square matrix of size $n\times n$. Consider the following program. What is the expected output? C=100 for i=1 to n do for j=1 to n do { Temp=A[i][j]+C A[i][j]=A[j][i] A[j][i]=Temp-C } for i=1 to n do for j=1 to n ... ]); The matrix $A$ itself. Transpose of matrix $A$. Adding $100$ to the upper diagonal elements and subtracting $100$ from diagonal elements of $A$. None of the option.
asked Mar 30 in Programming Lakshman Patel RJIT 57 views
1 vote
1 answer
19
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.
asked Mar 30 in Programming Lakshman Patel RJIT 59 views
1 vote
4 answers
20
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
asked Mar 30 in Programming Lakshman Patel RJIT 92 views
...