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
0
votes
0
answers
361
Self doubt
Can we use queue and stack in single array.... If yes the what will will be the overflow and underflow condition
Can we use queue and stack in single array.... If yes the what will will be the overflow and underflow condition
Rajouriya sanjay
266
views
Rajouriya sanjay
asked
Apr 1, 2022
0
votes
0
answers
362
integer promotion
#include<stdio.h> main() { short int i = 20; char c = 97; printf("%d, %d, %d \n", sizeof(c+1), sizeof(c+1.0), sizeof(c+i)); return 0; } What is the output?
#include<stdio.h>main(){short int i = 20;char c = 97;printf("%d, %d, %d \n", sizeof(c+1), sizeof(c+1.0), sizeof(c+i));return 0;}What is the output?
DEBANJAN DAS2k
301
views
DEBANJAN DAS2k
asked
Mar 29, 2022
Programming in C
programming-in-c
+
–
0
votes
0
answers
363
Suppose I have two files, a.c and b.c. The code for each of them is as follows:
Suppose I have two files, a.c and b.c. The code for each of them is as follows: a.c: #include<studio.h> main() { //somecode } b.c : #include<studio.h> printf("Hey"); Suppose I ... it will show? 1. Compiler Error 2. Linker Error 3. None, but shows Runtime error when executed. @Sachin Mittal 1
Suppose I have two files, a.c and b.c. The code for each of them is as follows:a.c:#include<studio.h>main(){ //somecode}b.c :#include<studio.h>printf("Hey");Suppose I ...
DEBANJAN DAS2k
279
views
DEBANJAN DAS2k
asked
Mar 28, 2022
Programming in C
programming-in-c
+
–
5
votes
1
answer
364
GO Classes 2023 | Weekly Quiz 4 | Question: 2
Which of the following expressions will evaluate to true? INT_MIN is the minimum signed integer in the system which is using 2's complement representation for signed integers and variables are defined as follows: int x = 5, i = -7; ((x >> 2) << 2) <= x ~ 1&& 1 INT_MIN == -INT_MIN -10 < i <-1
Which of the following expressions will evaluate to true?INT_MIN is the minimum signed integer in the system which is using 2's complement representation for signed integ...
GO Classes
820
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
goclasses
programming
programming-in-c
number-representation
multiple-selects
2-marks
+
–
6
votes
4
answers
365
GO Classes 2023 | Weekly Quiz 4 | Question: 10
int find(int n) { int i, j, k, a = 1; for (i = 1; i <= n; i++) for (j = 1; j <= i; j++) for (k = 1; k <= j; k++) a = a + 1; return a; } What will be the value of find$(10)$?
int find(int n) { int i, j, k, a = 1; for (i = 1; i <= n; i++) for (j = 1; j <= i; j++) for (k = 1; k <= j; k++) a = a + 1; return a; }What will be the value of find$(10)...
GO Classes
737
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
numerical-answers
programming
programming-in-c
loop
goclasses
2-marks
+
–
2
votes
3
answers
366
GO Classes 2023 | Weekly Quiz 4 | Question: 17
How many times is foo activated (called), including the first "$\text{foo}(3,12)$" $\text{max()}$ and $\text{min()}$ are functions that return maximum and minimum respectively. int foo(int a, int b) { if (a==b) { return b; } int mn =min(a,b), mx =max(a,b); return foo(mn,mn) + foo( mx - mn , mn); }
How many times is foo activated (called), including the first "$\text{foo}(3,12)$"$\text{max()}$ and $\text{min()}$ are functions that return maximum and minimum respecti...
GO Classes
561
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
numerical-answers
goclasses
programming
programming-in-c
recursion
2-marks
+
–
5
votes
3
answers
367
GO Classes 2023 | Weekly Quiz 4 | Question: 20
What will be output printed by $\text{mystery}2(6)$? void mystery2(int n) { if (n > 0) { printf("%d", n); mystery2(n-2); mystery2(n-3); printf("%d", n); } }
What will be output printed by $\text{mystery}2(6)$?void mystery2(int n) { if (n 0) { printf("%d", n); mystery2(n-2); mystery2(n-3); printf("%d", n); } }
GO Classes
540
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
goclasses
programming
programming-in-c
recursion
numerical-answers
1-mark
+
–
4
votes
3
answers
368
GO Classes 2023 | Weekly Quiz 4 | Question: 21
What will be the output printed by $\text{mystery}3(6)$? void mystery3(int n) { if (n == 0 || n == 1) return; mystery3(n-2); printf("%d", n); mystery3(n-1); }
What will be the output printed by $\text{mystery}3(6)$?void mystery3(int n) { if (n == 0 || n == 1) return; mystery3(n-2); printf("%d", n); mystery3(n-1); }
GO Classes
611
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
goclasses
programming
programming-in-c
recursion
numerical-answers
1-mark
+
–
5
votes
3
answers
369
GO Classes 2023 | Weekly Quiz 4 | Question: 22
Consider the following pair of mutually recursive functions. What does $g(g(2))$ evaluate to? int f(int n){ if (n==0) return 0; return f(n-1)+g(n-1); } int g(int n){ if (n==0) return 1; return g(n-1) + f(n); }
Consider the following pair of mutually recursive functions. What does $g(g(2))$ evaluate to?int f(int n){ if (n==0) return 0; return f(n-1)+g(n-1); } int g(int n){ if (n...
GO Classes
928
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
goclasses
programming
programming-in-c
recursion
numerical-answers
2-marks
+
–
9
votes
2
answers
370
GO Classes 2023 | Weekly Quiz 4 | Question: 23
Consider the following recursive function. What is $f(0)?$ int f(int x) { if (x > 1000) return x - 4; else return f(f(x+5)); }
Consider the following recursive function. What is $f(0)?$int f(int x) { if (x 1000) return x - 4; else return f(f(x+5)); }
GO Classes
650
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
goclasses
programming
programming-in-c
recursion
numerical-answers
2-marks
+
–
0
votes
0
answers
371
Self Doubt
problem : You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Q.here i am not understanding why these problem is following fibonacci series??
problem : You are climbing a staircase. It takes n steps to reach the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?...
Kartiksarvaiya
492
views
Kartiksarvaiya
asked
Mar 18, 2022
0
votes
0
answers
372
NPTEL Assignment of Hashing Techniques
Canadian postal codes have the format LDL DLD, where L is always a letter (between A-Z), D is always a digit (0-9), and is always a single space. For example, the postal code for the University of Waterloo is N2L 3G1. Devise a suitable hash function for this system.
Canadian postal codes have the format LDL DLD, where L is always a letter (between A-Z), D is always a digit (0-9), and is always a single space. For example, the postal ...
rsansiya111
387
views
rsansiya111
asked
Mar 12, 2022
DS
data-structures
hashing
+
–
1
votes
1
answer
373
Programming Self Doubt
Suppose we have a 32-bit memory and we have to represent unsigned int a = -5 What will the memory representation look like? 000000…….1011 or 111…..1011
Suppose we have a 32-bit memory and we have to representunsigned int a = -5What will the memory representation look like?000000…….1011or 111…..1011
tusharb
443
views
tusharb
asked
Mar 1, 2022
0
votes
1
answer
374
CRT-2022
Kindly help
Kindly help
rsansiya111
380
views
rsansiya111
asked
Feb 25, 2022
DS
array
+
–
0
votes
1
answer
375
CRT-2022
Kindly Help
Kindly Help
rsansiya111
357
views
rsansiya111
asked
Feb 25, 2022
DS
data-structures
+
–
19
votes
5
answers
376
GATE CSE 2022 | Question: 5
Consider the problem of reversing a singly linked list. To take an example, given the linked list below, the reversed linked list should look like Which one of the following statements is $\text{TRUE}$ about the time complexity of algorithms that solve the above problem ... $O(1)$ space.
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,the reversed linked list should look likeWhich one of the followin...
Arjun
9.5k
views
Arjun
asked
Feb 15, 2022
DS
gatecse-2022
data-structures
linked-list
1-mark
+
–
12
votes
3
answers
377
GATE CSE 2022 | Question: 11
What is printed by the following $\text{ANSI C}$ program? #include<stdio.h> int main(int argc, char *argv[]) { int x = 1, z[2] = {10, 11}; int *p = NULL; p = &x; *p = 10; p = &z[1]; *(&z[0] + 1) += 3; printf(“%d, %d, %d\n”, x, z[0], z[1]); return 0; } $1, 10, 11$ $1, 10, 14$ $10, 14, 11$ $10, 10, 14$
What is printed by the following $\text{ANSI C}$ program?#include<stdio.h int main(int argc, char *argv[]) { int x = 1, z = {10, 11}; int *p = NULL; p = &x; *p = 10; p =...
Arjun
5.9k
views
Arjun
asked
Feb 15, 2022
Programming in C
gatecse-2022
programming
programming-in-c
pointers
output
1-mark
+
–
41
votes
3
answers
378
GATE CSE 2022 | Question: 18
Suppose a binary search tree with $1000$ distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with $0,$ the $3^{\text{rd}}$ largest element of the tree is stored at index ______________ .
Suppose a binary search tree with $1000$ distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assumin...
Arjun
15.7k
views
Arjun
asked
Feb 15, 2022
DS
gatecse-2022
numerical-answers
data-structures
binary-search-tree
1-mark
+
–
13
votes
2
answers
379
GATE CSE 2022 | Question: 33
What is printed by the following $\text{ANSI C}$ program? #include<stdio.h> int main (int argc, char *argv[]) { int a[3][3][3] = {{1, 2, 3, 4, 5, 6, 7, 8, 9}, {10, 11, 12, 13, 14, 15, 16, 17, 18}, {19, 20, 21, 22, 23, 24, 25, 26, 27}} ... $\begin {array}{} 1 & 2 & 3 \\ 13 & 14 & 15 \\ 25 & 26 & 27 \end{array}$
What is printed by the following $\text{ANSI C}$ program?#include<stdio.h int main (int argc, char *argv[]) { int a[3][3][3] = {{1, 2, 3, 4, 5, 6, 7, 8, 9}, {10, 11, 12, ...
Arjun
8.3k
views
Arjun
asked
Feb 15, 2022
Programming in C
gatecse-2022
programming
programming-in-c
array
output
2-marks
+
–
19
votes
1
answer
380
GATE CSE 2022 | Question: 34
What is printed by the following $\text{ANSI C}$ program? #include<stdio.h> int main(int argc, char *argv[]) { char a = P'; char b = x'; char c = (a&b) + *'; char d = (a|b) - -'; char e = (a^b) + +'; printf( %c %c %c\n , c, d, e); return 0; } ... $\text{z K S}$ $122 \; 75 \; 83$ $ * \; - \; + $ $\text{P x +}$
What is printed by the following $\text{ANSI C}$ program?#include<stdio.h int main(int argc, char *argv[]) { char a = ‘P’; char b = ‘x’; char c = (a&b) + ‘*’;...
Arjun
11.3k
views
Arjun
asked
Feb 15, 2022
Programming in C
gatecse-2022
programming
programming-in-c
output
2-marks
+
–
Page:
« prev
1
...
14
15
16
17
18
19
20
21
22
23
24
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register