Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Recent questions in Programming and DS
2
votes
1
answer
3381
Test by Bikram | Programming | Test 2 | Question: 9
Consider the below function: int s (int n) { if (n<=1) return 1 ; n = (n-1) * (n-1) -2 - n * n + 3*n ; s(n); printf(“%d”, n ); } What is the output if initial call is $s(6)$ ? $55555$ $11111$ $54321$ $12345$
Consider the below function:int s (int n) { if (n<=1) return 1 ; n = (n-1) * (n-1) -2 - n * n + 3*n ; s(n); printf(“%d”, n ); }What is the output if initial call is $...
Bikram
372
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
identify-function
+
–
2
votes
2
answers
3382
Test by Bikram | Programming | Test 2 | Question: 8
What is the output of this program? #include <stdio.h> int main() { char *ptr; char string[] = "How are you?"; ptr = string; ptr += 4; printf("%s",ptr); return 0; } How are you? are you? are error in program
What is the output of this program?#include <stdio.h int main() { char *ptr; char string[] = "How are you?"; ptr = string; ptr += 4; printf("%s",ptr); return 0; }How are ...
Bikram
467
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
0
votes
1
answer
3383
Test by Bikram | Programming | Test 2 | Question: 7
The value of p after execution of the following program will be: int new(int t) { static int cal=0; cal=cal+t; return(cal); } main() { int t,p; for(t=0;t<=4;t++) p= new(t); } $10$ $4$ $6$ $7$
The value of p after execution of the following program will be:int new(int t) { static int cal=0; cal=cal+t; return(cal); } main() { int t,p; for(t=0;t<=4;t++) p= new(t)...
Bikram
185
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
0
votes
0
answers
3384
Test by Bikram | Programming | Test 2 | Question: 6
Which among following statements is/are TRUE? & is bit-wise and && is a logical operator & returns an integer value whereas && returns a boolean value Both the above options are correct Both (A) and (B) are incorrect
Which among following statements is/are TRUE?& is bit-wise and && is a logical operator& returns an integer value whereas && returns a boolean valueBoth the above options...
Bikram
407
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
binary-operation
programming-in-c
+
–
1
votes
1
answer
3385
Test by Bikram | Programming | Test 2 | Question: 5
#include <stdio.h> void fun() { int p; static int x=1; p = ++x; printf("%d %d", p, x); if(p <= 2) fun(); printf(“%d %d”, p, x); } int main() { fun(); fun(); } In the above code fragment, the total number of times printf statement will be executed is _________.
#include <stdio.h void fun() { int p; static int x=1; p = ++x; printf("%d %d", p, x); if(p <= 2) fun(); printf(“%d %d”, p, x); } int main() { fun(); fun(); }In the ab...
Bikram
410
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
0
votes
1
answer
3386
Test by Bikram | Programming | Test 2 | Question: 3
What is the output of this program? #include <stdio.h> #include <string.h> int main() { char string[] = "Hello"; printf("%lu %lu", sizeof(string), strlen(string)); return 0; } $5 \ 6$ $5 \ 5$ $6 \ 5$ $6 \ 6$
What is the output of this program?#include <stdio.h #include <string.h int main() { char string[] = "Hello"; printf("%lu %lu", sizeof(string), strlen(string)); return 0;...
Bikram
352
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
4
votes
2
answers
3387
Test by Bikram | Programming | Test 2 | Question: 4
State the output in below code snippet : #include <stdio.h> int main(void) { char x[5] = { 1, 2, 3, 4, 5 }; char *ptr = (char*)(&x + 1); printf("%d %d\n", *(x + 1), *(ptr - 1)); return 0; } Compile Error $2 \ 1$ $2 \ 5$ $3 \ 4$
State the output in below code snippet :#include <stdio.h int main(void) { char x[5] = { 1, 2, 3, 4, 5 }; char *ptr = (char*)(&x + 1); printf("%d %d\n", *(x + 1), *(ptr -...
Bikram
803
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
2
votes
1
answer
3388
Test by Bikram | Programming | Test 2 | Question: 2
Which of the following statements is/are true ? #include <stdio.h> int main() { int x=10, y=200%90, i; for( i=1;i++<=10;); if(x==y); printf("x=%dy=%d\n",x,y ); return 0; } printf() is called infinite times program will produce output x=10,y=20; The program will not produce any output The program will produce some error
Which of the following statements is/are true ?#include <stdio.h int main() { int x=10, y=200%90, i; for( i=1;i++<=10;); if(x==y); printf("x=%dy=%d\n",x,y ); return 0; }p...
Bikram
516
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
programming-in-c
+
–
1
votes
1
answer
3389
Test by Bikram | Programming | Test 2 | Question: 1
Consider the following C program using function : #include<stdio.h> main() { int f1(int,int); int x = 9, n=3, S; S = f1(x,n); printf(S); } int f1(int x, int n) { int y=1, i=1; for(i=1;i<=n;i++) y=y*x; return(y); } Output will be ______
Consider the following C program using function : #include<stdio.h main() { int f1(int,int); int x = 9, n=3, S; S = f1(x,n); printf(S); } int f1(int x, int n) { int y=1,...
Bikram
280
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
0
votes
1
answer
3390
Regarding EOF in C
I have read that in Linux, user can do CTRL+D and it's leads to equivalent, but I have an question that user has to press CTRL+D or write CTRL+D in program like a character.
I have read that in Linux, user can do CTRL+D and it's leads to equivalent, but I have an question that user has to press CTRL+D or write CTRL+D in program like a charact...
iarnav
314
views
iarnav
asked
May 14, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
3391
Test by Bikram | Mock GATE | Test 4 | Question: 45
Consider the following code snippet: #include <stdio.h> void s1(int*, int); void s2(int*, int); void (*k[2])(int*, int); int main() { int a = 4; int b = 2; k[0] = s1; k[1] = s2; k[0](&a, b); printf("%d %d ", a, ... void s2(int *k, int q) { int tmp = *k; *k = q; q = tmp; } The output of the above program is : 4242 2222 4444 2424
Consider the following code snippet:#include <stdio.h void s1(int*, int); void s2(int*, int); void (*k )(int*, int); int main() { int a = 4; int b = 2; k[0] = s1; k = s2...
Bikram
426
views
Bikram
asked
May 14, 2017
Programming in C
tbb-mockgate-4
programming
programming-in-c
array-of-pointers
+
–
5
votes
1
answer
3392
Test by Bikram | Mock GATE | Test 4 | Question: 40
Consider the below program : #include <stdio.h> void fun (int[0][3]); int main(void) { int k[3][3]= {{1,2,3}, {4,5,6},{7,8,9}}; fun(k); printf("%d\n", k[2][1]); return 0; } void fun(int p[][3]) { ++p; p[1][1] = 9; } The output of the above program is : ______.
Consider the below program : #include <stdio.h void fun (int[0][3]); int main(void) { int k[3][3]= {{1,2,3}, {4,5,6},{7,8,9}}; fun(k); printf("%d\n", k ); return 0; } vo...
Bikram
405
views
Bikram
asked
May 14, 2017
Programming in C
tbb-mockgate-4
numerical-answers
programming-in-c
array
+
–
1
votes
1
answer
3393
Test by Bikram | Mock GATE | Test 4 | Question: 38
In a height balanced binary search tree, the heights of the left and right descendants of any node differ at most by $1.$ Which of the following statements are TRUE for such kind of tree? Worst case search time is logarithmic in the number of nodes. ... is logarithmic in the number of nodes. II and IV only I, II and IV I and III only I, III and IV
In a height balanced binary search tree, the heights of the left and right descendants of any node differ at most by $1.$ Which of the following statements are TRUE for s...
Bikram
430
views
Bikram
asked
May 14, 2017
DS
tbb-mockgate-4
data-structures
avl-tree
binary-search-tree
+
–
1
votes
1
answer
3394
Test by Bikram | Mock GATE | Test 4 | Question: 31
An $m-ary$ tree is a tree in which every node has at most $m$ children. In an $m-ary$ tree with $p$ nodes and height $l$ $($starting from $0)$, which of the following is the tightest upper bound for the maximum number of leaves as a function of $l$, $m$, and $p$? $\lg m \times p$ $\lg m \times l \times \lg p$ $l^m$ $m^l$
An $m-ary$ tree is a tree in which every node has at most $m$ children. In an $m-ary$ tree with $p$ nodes and height $l$ $($starting from $0)$, which of the following is ...
Bikram
387
views
Bikram
asked
May 14, 2017
DS
tbb-mockgate-4
data-structures
tree
binary-tree
+
–
0
votes
1
answer
3395
Test by Bikram | Mock GATE | Test 4 | Question: 13
Consider an initially empty hash table of length $10$. Following set of keys are inserted using open addressing with hash function $h\left ( k \right )=k\mod 10$ and linear probing. $2$, $13$, $24$, $12$, $62$, $73$, $82$, $91$ The number of probes done while searching for element $82$ is __________.
Consider an initially empty hash table of length $10$. Following set of keys are inserted using open addressing with hash function $h\left ( k \right )=k\mod 10$ and line...
Bikram
395
views
Bikram
asked
May 14, 2017
DS
tbb-mockgate-4
numerical-answers
data-structures
algorithms
hashing
+
–
2
votes
1
answer
3396
Test by Bikram | Mock GATE | Test 4 | Question: 7
Consider the following statements: $S_1$: If a STACK is implemented through a LINKED LIST, $\text{PUSH}$ operation will take $O\left ( 1 \right )$ time and $\text{POP}$ operation will take $O\left ( n \right )$ time. $S_2$: If a QUEUE ... $S_1$ is correct. Only $S_2$ is correct. Neither $S_1$ nor $S_2$ is correct. Both $S_1$ and $S_2$ are correct.
Consider the following statements:$S_1$: If a STACK is implemented through a LINKED LIST, $\text{PUSH}$ operation will take $O\left ( 1 \right )$ time and $\text{POP}$ op...
Bikram
766
views
Bikram
asked
May 14, 2017
DS
tbb-mockgate-4
data-structures
stack
queue
+
–
3
votes
1
answer
3397
Test by Bikram | Mock GATE | Test 4 | Question: 6
Consider the below $C$ code: #include<stdio.h> int main() { char a[] = "gateoverflow"; char *p = a; printf("%s", p+p[3]-p[1]); } The output will be : gate eoverflow overflow Garbage error
Consider the below $C$ code:#include<stdio.h int main() { char a[] = "gateoverflow"; char *p = a; printf("%s", p+p[3]-p ); }The output will be : gate eoverflow overflo...
Bikram
270
views
Bikram
asked
May 14, 2017
Programming in C
tbb-mockgate-4
programming
programming-in-c
+
–
4
votes
3
answers
3398
Test by Bikram | Mock GATE | Test 4 | Question: 5
The time complexity of the best known algorithm to find $p^{th}$ ${\left ( p<n \right )}$ smallest element from a $minheap$ of $n$ elements is _______. $\Theta\left ( p\log p \right )$ $\Theta\left ( p\log n \right )$ $\Theta\left ( pn \right )$ $\Theta\left ( n\log p \right )$
The time complexity of the best known algorithm to find $p^{th}$ ${\left ( p<n \right )}$ smallest element from a $minheap$ of $n$ elements is _______.$\Theta\left ( p\lo...
Bikram
903
views
Bikram
asked
May 14, 2017
DS
tbb-mockgate-4
time-complexity
binary-heap
+
–
0
votes
1
answer
3399
C-programming question
why getch( ), putch( ),getchar() Putchar( ) etc function in c exist when we have printf and scanf functions ? What is importance of these functions??
why getch( ), putch( ),getchar()Putchar( ) etc function in c exist when we have printf and scanf functions ?What is importance of these functions??
MV
1.8k
views
MV
asked
May 13, 2017
0
votes
1
answer
3400
previous
chandra sai
306
views
chandra sai
asked
May 12, 2017
Page:
« prev
1
...
165
166
167
168
169
170
171
172
173
174
175
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register