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

1 vote
1 answer
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
asked Mar 30, 2020 in Programming Lakshman Patel RJIT 278 views
1 vote
1 answer
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
asked Mar 30, 2020 in Programming Lakshman Patel RJIT 170 views
1 vote
1 answer
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
asked Mar 30, 2020 in Programming Lakshman Patel RJIT 323 views
1 vote
2 answers
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.
asked Mar 30, 2020 in Programming Lakshman Patel RJIT 260 views
1 vote
4 answers
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
asked Mar 30, 2020 in Programming Lakshman Patel RJIT 308 views
0 votes
2 answers
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$
asked Mar 30, 2020 in Programming Lakshman Patel RJIT 609 views
1 vote
1 answer
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$
asked Mar 28, 2020 in Programming jothee 131 views
1 vote
1 answer
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); }
asked Mar 28, 2020 in Programming jothee 104 views
1 vote
1 answer
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$
asked Mar 27, 2020 in Programming jothee 136 views
1 vote
1 answer
10
The declaration “unsigned u” indicates : u is an unsigned character u is an unsigned integer u is a character u is a string
asked Mar 27, 2020 in Programming jothee 90 views
2 votes
5 answers
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
asked Mar 27, 2020 in Programming jothee 586 views
1 vote
2 answers
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$
asked Mar 26, 2020 in Programming jothee 470 views
1 vote
8 answers
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$
asked Mar 26, 2020 in Programming jothee 605 views
3 votes
2 answers
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
asked Mar 26, 2020 in Programming jothee 261 views
1 vote
1 answer
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$
asked Mar 26, 2020 in Programming jothee 81 views
1 vote
1 answer
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
asked Mar 26, 2020 in Programming jothee 86 views
1 vote
0 answers
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
asked Mar 26, 2020 in Programming jothee 50 views
5 votes
3 answers
18
#include int main( ) { int x=5, y=9; x=(x= x+y)-(y= x-y); printf("%d %d ", x, y); return 0; } A. 9 5 B. 5 14 C. 14 5 D. 5 9
asked Mar 5, 2020 in Programming vivek_mishra 282 views
14 votes
4 answers
19
Consider the following C program. #include <stdio.h> int main () { int a[4] [5] = {{1, 2, 3, 4, 5}, {6, 7,8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17,18, 19, 20}}; printf(“%d\n”, *(*(a+**a+2)+3)); return(0); } The output of the program is _______.
asked Feb 12, 2020 in Programming Arjun 6.5k views
17 votes
5 answers
20
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 _________
asked Feb 12, 2020 in Programming Arjun 5.4k views
...