Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions and answers in Programming and DS
0
votes
0
answers
1
self doubt
let suppose address of first index of array is n and size of each block of array is u. then the index of second element is a+u. let suppose the array has m elements. what will be the address of the third element of an array if it's address second last element is (n - u).
let suppose address of first index of array is n and size of each block of array is u. then the index of second element is a+u.let suppose the array has m elements.what w...
srijankarak_123
2
views
srijankarak_123
asked
14 minutes
ago
19
votes
5
answers
2
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...
yudhistar
9.4k
views
yudhistar
answered
11 hours
ago
DS
gatecse-2022
data-structures
linked-list
1-mark
+
–
0
votes
0
answers
3
i am not able to give test
arjun1947
16
views
arjun1947
asked
1 day
ago
0
votes
0
answers
4
university assignment question
The array-based stack throws an exception when the array's capacity has been reached. Consider the following alternative : create a larger array, using the resize method. The cost of a resize that makes the array larger is proportional to the new size. 1. Suppose we ... and 2 for queues.Note that after the resize, elements may Solutions = O(N^2) O(N) O(N^2) O(N)
The array-based stack throws an exception when the array’s capacity has been reached. Consider the following alternative : create a larger array, using the resize metho...
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
37
views
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
asked
1 day
ago
67
votes
5
answers
5
GATE CSE 2006 | Question: 13
A scheme for storing binary trees in an array $X$ is as follows. Indexing of $X$ starts at $1$ instead of $0$. the root is stored at $X[1]$. For a node stored at $X[i]$, the left child, if any, is stored in $X[2i]$ and the right child, if any, in $X[2i+1]$. To be able to store any binary tree on n vertices the minimum size of $X$ should be $\log_2 n$ $n$ $2n+1$ $2^n-1$
A scheme for storing binary trees in an array $X$ is as follows. Indexing of $X$ starts at $1$ instead of $0$. the root is stored at $X $. For a node stored at $X[i]$, th...
snehasish
17.4k
views
snehasish
answered
3 days
ago
DS
gatecse-2006
data-structures
binary-tree
normal
+
–
0
votes
1
answer
6
UGC NET CSE | June 2010 | Part 2 | Question: 33
Consider the following left associative operators in decreasing order of precedence : - subtraction (highest precedence) * multiplication $ exponentiation (lowest precedence) What is the result of the following expression ? 3 – 2 * 4 $ | * 2** 3 $-61$ $64$ $512$ $4096$
Consider the following left associative operators in decreasing order of precedence :- subtraction (highest precedence)* multiplication$ exponentiation (lowest precedence...
Vivek kadam
1.4k
views
Vivek kadam
answered
5 days
ago
Programming in C
ugcnetcse-june2010-paper2
programming
operator-precedence
+
–
1
votes
1
answer
7
GO Classes 2024 | IIITH Mock Test 5 | Question: 46
In which of the following case(s) character array must end with null char? char c[] = "GATE"; char c[] = {'2', '0', '2', '3'}; char c[4] = "GATE"; char c[16] = "2023";
In which of the following case(s) character array must end with null char?char c[] = "GATE";char c[] = {'2', '0', '2', '3'};char c[4] = "GATE";char c[16] = "2023";
anishsp
222
views
anishsp
answered
5 days
ago
Programming in C
goclasses2024-iiith-mock-5
goclasses
programming
programming-in-c
array
multiple-selects
1-mark
+
–
0
votes
2
answers
8
C Programming - Arrays & Pointer (NAT)
#include <stdio.h> int main() { int a[3][2] = {1, 3, 5, 7, 9, 11}; int *ptr = a[0]; ptr += sizeof(int); printf("%d", *ptr); return 0; } (Assume size of int to be $2$ bytes.) The output is __________.
#include <stdio.h int main() { int a[3] = {1, 3, 5, 7, 9, 11}; int *ptr = a[0]; ptr += sizeof(int); printf("%d", *ptr); return 0; }(Assume size of int to be $2$ bytes.)T...
kumaruk
137
views
kumaruk
answered
5 days
ago
Programming in C
array
data-structures
programming-in-c
+
–
2
votes
2
answers
9
GO Classes 2024 | IIITH Mock Test 5 | Question: 16
What will be printed by following $\text{C}$ code? int a[7] = {0, 1, 2, 3, 4, 5, 6}; int *p = &a[3]; p += 2; *p += 2; printf("%d", *p++); $6$ $7$ $8$ $9$
What will be printed by following $\text{C}$ code?int a[7] = {0, 1, 2, 3, 4, 5, 6}; int *p = &a[3]; p += 2; *p += 2; printf("%d", *p++);$6$$7$$8$$9$
naval
188
views
naval
answered
6 days
ago
Programming in C
goclasses2024-iiith-mock-5
goclasses
programming
programming-in-c
pointers
1-mark
+
–
1
votes
2
answers
10
Test series question of ace academy
#include<stdio.h> #define ADD(a,b)(a+b) #define SQUARE(x)(x*x) int main() { int x=2; int y=3; int z = ADD(SQUARE(x++),y); printf("%d\n",z); return 0; } What is the output of the above code snippet?
#include<stdio.h>#define ADD(a,b)(a+b)#define SQUARE(x)(x*x)int main(){int x=2;int y=3;int z = ADD(SQUARE(x++),y);printf("%d\n",z);return 0;}What is the output of the abo...
Abha Gupta
145
views
Abha Gupta
answered
Apr 29
Programming in C
ace-test-series
+
–
5
votes
2
answers
11
GATE CSE 2024 | Set 2 | Question: 23
Consider the following $\mathrm{C}$ function definition. int f X(char * a) { char * b = a; while (*b) b ++; return b - a; } Which of the following statements is/are TRUE? The function call $\text{f X("a b c d''}$) will ... ${ }^{*} \mathrm{C}=$ "abcd" in main (), the function call $\mathrm{fX}(\mathrm{c})$ will always return a value
Consider the following $\mathrm{C}$ function definition.int f X(char * a) { char * b = a; while (*b) b ++; return b - a; }Which of the following statements is/ar...
saini.tarun51
2.6k
views
saini.tarun51
answered
Apr 28
Programming in C
gatecse2024-set2
programming
programming-in-c
multiple-selects
output
+
–
3
votes
1
answer
12
GO Classes 2023 | IIITH Mock Test 1 | Question: 14
Consider a perfect binary tree with $\mathrm{n}$ nodes and $\mathrm{h}$ height. A tree is perfect when all levels of the tree are completely full. Let root is at depth $0$ and leaves are at height $0.$ Assume Expected height of any ... $S1$ is correct but $S2$ is incorrect $S1$ is incorrect but $S2$ is correct Both are correct Both are incorrect
Consider a perfect binary tree with $\mathrm{n}$ nodes and $\mathrm{h}$ height. A tree is perfect when all levels of the tree are completely full. Let root is at depth $0...
Poojan Sheth
986
views
Poojan Sheth
answered
Apr 26
DS
goclasses2023-iiith-mock-1
goclasses
data-structures
tree
binary-tree
1-mark
+
–
1
votes
2
answers
13
DRDO CSE 2022 Paper 1 | Question: 29
Five items $\text{A, B, C, D, E}$ are pushed onto a stack, one after other starting from item $\mathrm{A}$. The stack is then popped by three items, and each item is inserted into a queue. Next, two items are deleted from the queue, ... deleted items are pushed back onto the stack. Now, one item is popped from the stack. Which item is at the top of the stack.
Five items $\text{A, B, C, D, E}$ are pushed onto a stack, one after other starting from item $\mathrm{A}$. The stack is then popped by three items, and each item is inse...
soumya24
562
views
soumya24
answered
Apr 22
DS
drdocse-2022-paper1
data-structures
stack
5-marks
descriptive
+
–
1
votes
0
answers
14
Arrays
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element present at location arr[–6][4] is- ____________.
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element pres...
piyush512
128
views
piyush512
asked
Apr 20
DS
array
data-structures
+
–
2
votes
2
answers
15
GATE CSE 2024 | Set 1 | Question: 38
Consider the following $\mathrm{C}$ ... the return value is less than $2^{10}$ If the inputs are $x=10, y=20$, then the return value is greater than $2^{20}$
Consider the following $\mathrm{C}$ function definition.int f (int x, int y){ for (int i=0 ; i<y ; i++ ) { x= x + x + y; } return x; }Which of the following stateme...
subhajit1998
2.4k
views
subhajit1998
answered
Apr 19
Programming in C
gatecse2024-set1
multiple-selects
programming
programming-in-c
+
–
0
votes
0
answers
16
Bitwise Operator - C Programming
Problem Statement: Class teacher to IX-C wants to store whether a particular student has passed in exams. The class has a strength of $32$ students. Their roll numbers lie in the range: $[1, 32]$. The teacher used bits of an integer to store ... Bitwise OR (|) operator and count number of set bits d. Apply Bitwise AND (&) operator and count number of set bits
Problem Statement: Class teacher to IX-C wants to store whether a particular student has passed in exams. The class has a strength of $32$ students. Their roll numbers li...
Debargha Mitra Roy
180
views
Debargha Mitra Roy
asked
Apr 12
Programming in C
programming-in-c
operator-precedence
boolean-algebra
+
–
1
votes
1
answer
17
Consider the following program: #include <stdio.h> int main(){ int a=2, i; static int b=a++; for(i=0;i<a+b;i++) printf("GATE Wallah"); return 0; } Which of the following is/are CORRECT? (a) GATE Wallah is printed 3 times. (b) GATE Wallah is printed 4 times. (c) GATE Wallah is printed 5 times. (d) Compilation Error.
Consider the following program: #include <stdio.h int main(){ int a=2, i; static int b=a++; for(i=0;i<a+b;i++) printf("GATE Wallah"); return 0; }Which of the following is...
Sun Wukong
91
views
Sun Wukong
answered
Apr 12
0
votes
2
answers
18
C Programming - Recursion
What is the output of the below code? #include <stdio.h> void main() { static int var = 5; printf("%d ", var--); if (var) main(); } a. 1 2 3 4 5 b. 1 c. 5 4 3 2 1 d. Error
What is the output of the below code?#include <stdio.h void main() { static int var = 5; printf("%d ", var ); if (var) main(); }a. 1 2 3 4 5b. 1c. 5 4 3 2 1d. Error
Sun Wukong
152
views
Sun Wukong
answered
Apr 11
Programming in C
recursion
programming-in-c
programming
+
–
1
votes
1
answer
19
#Recursivefunctions
int bar(int val){ int x=0; while(val > 0){ x=x+bar(val -1); } return val; } Q: For bar(3) this function is supposed to be stuck in an infinite loop but I do not know how please can someone explain?
int bar(int val){int x=0;while(val 0){x=x+bar(val -1);}return val;}Q: For bar(3) this function is supposed to be stuck in an infinite loop but I do not know how please c...
Sun Wukong
108
views
Sun Wukong
answered
Apr 9
Programming in C
recursion
functions
+
–
0
votes
1
answer
20
class question self doubt
#include<stdio.h> #include<conio.h> int main(){ int a[][3]={ {4,14,24},{5,15,25},{6,16,26}}; int *p[3]; int **ptr=p; p[0]=a; p[1]=a+1; p[2]=a+2; ++*p; ++p[0]; ++**ptr; ++*p[0]; ++ptr; ++*ptr; --*p[1]; --*ptr; ++ptr; --p[ ... ("\n%d,%d,%d",a[0][2],a[1][1],a[2][0]); printf("\n%d,%d,%d",*p[0],*p[1],*p[2]); } what is the output of above program
#include<stdio.h>#include<conio.h>int main(){ int a[][3]={ {4,14,24},{5,15,25},{6,16,26}}; int *p[3]; int ptr=p; p[0]=a; p =a+1; p =a+2; ++*p; ...
C1h2a3i4t5
200
views
C1h2a3i4t5
answered
Apr 8
1
votes
2
answers
21
DRDO CSE 2022 Paper 1 | Question: 28
If the maximum height of a binary tree is $\mathrm{N},$ then how many number of nodes will there be?
If the maximum height of a binary tree is $\mathrm{N},$ then how many number of nodes will there be?
C1h2a3i4t5
307
views
C1h2a3i4t5
answered
Apr 8
DS
drdocse-2022-paper1
data-structures
binary-tree
4-marks
descriptive
+
–
0
votes
3
answers
22
Extern in C programming
int main() { extern int a = 20; printf("%d",a); } //why this gives error but followig code is not extern int a =20; int main() { printf("%d",a); } //why this happens that first code gives error but second is not ? //please tell i am realy confused now
int main(){extern int a = 20;printf("%d",a); }//why this gives error but followig code is not extern int a =20;int main(){printf("%d",a); } //why this happens that first ...
Abhishek_student
1.1k
views
Abhishek_student
answered
Apr 4
Programming in C
algorithms
programming-in-c
+
–
131
votes
4
answers
23
GATE CSE 2014 Set 2 | Question: 11
Suppose $n$ and $p$ are unsigned int variables in a C program. We wish to set $p$ to $^nC_3$. If $n$ is large, which one of the following statements is most likely to set $p$ correctly? $p = n * (n-1) * (n-2) / 6;$ $p = n * (n-1) / 2 * (n-2) / 3;$ $p = n * (n-1) / 3 * (n-2) / 2;$ $p = n * (n-1) * (n-2) / 6.0;$
Suppose $n$ and $p$ are unsigned int variables in a C program. We wish to set $p$ to $^nC_3$. If $n$ is large, which one of the following statements is most likely to set...
ayan2000
15.7k
views
ayan2000
answered
Mar 28
Programming in C
gatecse-2014-set2
programming
programming-in-c
normal
+
–
6
votes
4
answers
24
GO Classes Weekly Quiz 2 | Programming in C | Propositional Logic | Question: 2
What will be output printed by the following program? #include<stdio.h> main() { int c=4; switch(c) { c=c-1; case 4: printf("IITB "); break; default: printf("IISc "); case 3: printf("IITM " ... ;); } } $\text{IITB IITM}$ $\text{IITB IISc IITM}$ $\text{IITB}$ $\text{IITB IITM IITD}$
What will be output printed by the following program?#include<stdio.h main() { int c=4; switch(c) { c=c-1; case 4: printf("IITB ")...
geetaseshapallli
1.1k
views
geetaseshapallli
answered
Mar 26
Programming in C
goclasses_wq2
goclasses
programming
programming-in-c
output
1-mark
+
–
2
votes
3
answers
25
UPPCL AE 2018:34
What is the output of the following $\text{C}$ program? #include<stdio.h> int main(void){ char s1[] = “Hello”; char s2[] = “World!”; s1 = s2; printf(“%s”,s1); } “World!” “HelloWorld!” “Compilation error” “Hello”
What is the output of the following $\text{C}$ program?#include<stdio.h int main(void){ char s1[] = “Hello”; char s2[] = “World!”; s1 = s2; printf(“%s”,s1); }...
geetaseshapallli
434
views
geetaseshapallli
answered
Mar 26
Programming in C
uppcl2018
programming
programming-in-c
output
+
–
18
votes
4
answers
26
GATE CSE 2023 | Question: 25
The integer value printed by the $\textsf{ANSI-C}$ program given below is _______________ #include<stdio.h> int funcp(){ static int x = 1; x++; return x; } int main(){ int x,y; x = funcp(); y = funcp()+x; printf("%d\n", (x+y)); return 0; }
The integer value printed by the $\textsf{ANSI-C}$ program given below is _______________#include<stdio.h int funcp(){ static int x = 1; x++; return x; } int main(){ int ...
ritiksri8
11.2k
views
ritiksri8
answered
Mar 25
Programming in C
gatecse-2023
programming
programming-in-c
output
numerical-answers
1-mark
+
–
0
votes
1
answer
27
GATE CSE 1988 | Question: 8iii
Write a LISP function to compute the product of all the numbers in a list. Assume that the list contains only number.
Write a LISP function to compute the product of all the numbers in a list. Assume that the list contains only number.
cprdereddyy
495
views
cprdereddyy
answered
Mar 25
Programming in C
gate1988
descriptive
programming
lisp
out-of-gate-syllabus
+
–
3
votes
0
answers
28
GATE CSE SET-1 2024
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
RahulVerma3
166
views
RahulVerma3
asked
Mar 22
Programming in C
programming-in-c
programming
+
–
40
votes
11
answers
29
GATE CSE 2021 Set 2 | Question: 10
Consider the following $\text{ANSI C}$ program. #include <stdio.h> int main() { int arr[4][5]; int i, j; for (i=0; i<4; i++) { for (j=0; j<5; j++) { arr[i][j] = 10 * i + j; } } printf(“%d”, *(arr[1]+9)); return 0; } What is the output of the above program? $14$ $20$ $24$ $30$
Consider the following $\text{ANSI C}$ program.#include <stdio.h int main() { int arr[4][5]; int i, j; for (i=0; i<4; i++) { for (j=0; j<5; j++) { arr[i...
Subham640
30.4k
views
Subham640
answered
Mar 18
Programming in C
gatecse-2021-set2
programming-in-c
array
output
1-mark
+
–
48
votes
8
answers
30
GATE CSE 2015 Set 3 | Question: 7
Consider the following C program segment. # include <stdio.h> int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); } What will be printed by the program? $12$ $120400$ $1204$ $1034$
Consider the following C program segment.# include <stdio.h int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); }What will be printed by the pro...
Subham640
16.4k
views
Subham640
answered
Mar 17
Programming in C
gatecse-2015-set3
programming
programming-in-c
normal
array
+
–
0
votes
0
answers
31
GATE 2024 CSE1
I have a question that can we use command line arguments without main function arguments? int main(int argc, char **argv){ }
I have a question that can we use command line arguments without main function arguments?int main(int argc, char argv){}
RahulVerma3
158
views
RahulVerma3
asked
Mar 16
Programming in C
programming-in-c
usergate2024
+
–
0
votes
1
answer
32
Gate 2017 Set 1 minimum Comparisons
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required in worst case by optimal algorithm?
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required ...
teja1521
225
views
teja1521
answered
Mar 11
Programming in C
numerical-answers
algorithms
+
–
2
votes
2
answers
33
let x be an array of integer which of the following can not be present in the LHS of an assignment statement
let x be an array of integer . which of the following can not be present in the left hand side of an assignment statementa)x b) x+i c) * (x+i) d) &x[i]
teja1521
2.6k
views
teja1521
answered
Mar 11
1
votes
3
answers
34
UGC NET CSE | December 2004 | Part 2 | Question: 22
Suppose we are implementing quadratic probing with a Hash function, Hash $(y)=X$ mode $100$. If an element with key $4594$ is inserted and the first three locations attempted are already occupied, then the next cell that will be tried is : $2$ $3$ $9$ $97$
Suppose we are implementing quadratic probing with a Hash function, Hash $(y)=X$ mode $100$. If an element with key $4594$ is inserted and the first three locations attem...
ajayraho
1.7k
views
ajayraho
answered
Mar 11
DS
ugcnetcse-dec2004-paper2
+
–
1
votes
1
answer
35
DRDO CSE 2022 Paper 1 | Question: 26 (b)
Provide the correct data structures for the following: Asynchronous data transfer and accessing shared resource involve _________.
Provide the correct data structures for the following:Asynchronous data transfer and accessing shared resource involve _________.
mishraamulya
347
views
mishraamulya
answered
Mar 10
DS
drdocse-2022-paper1
data-structures
1-mark
fill-in-the-blanks
+
–
1
votes
1
answer
36
Array
Does C support fractional Indices? float x = some fraction; Is float a[x] valid declaration?
Does C support fractional Indices?float x = some fraction;Is float a[x] valid declaration?
teja1521
190
views
teja1521
answered
Mar 8
Programming in C
array
programming-in-c
+
–
2
votes
3
answers
37
Made Easy Mock -1
how does the program is working..? answer – 8
how does the program is working..?answer – 8
teja1521
431
views
teja1521
answered
Mar 8
Programming in C
programming
numerical-answers
made-easy-test-series
+
–
6
votes
3
answers
38
GO Classes Test Series 2024 | Programming | Test 2 | Question: 21
What will be the output of the following program? #include<stdio.h> int rec(int x, int y) { static int count = 0; if (x == 0) return count; count++; if (x > y) rec(x - y, y); else rec(x, y - x); return count; } main() { int i = 10, j = 2, n; n = rec(i, j); printf("%d", n); } $4$ $5$ $6$ Infinite loop
What will be the output of the following program?#include<stdio.h int rec(int x, int y) { static int count = 0; if (x == 0) return count; count++; if (x y) rec(x - y, y)...
teja1521
428
views
teja1521
answered
Mar 8
Programming in C
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
recursion
output
2-marks
+
–
1
votes
3
answers
39
GATE CSE 2024 | Set 1 | Question: 9
Consider the following $\mathrm{C}$ program: #include <stdio.h> void fX (); int main(){ fX(); return 0 }; void fX () { char a; if ((a=g e t c h a r()) ! = '\n') fX(); if (a ! ... program will not terminate The program will terminate with no output The program will terminate with $4321$ as output The program will terminate with $1234$ as output
Consider the following $\mathrm{C}$ program:#include <stdio.h void fX (); int main(){ fX(); return 0 };void fX () { char a; if ((a=g e t c h a r()) ! = '\n') ...
shah___
3.2k
views
shah___
answered
Mar 6
Programming in C
gatecse2024-set1
programming
programming-in-c
output
+
–
0
votes
1
answer
40
s.balaguruswami
Find the error of the following IP addresses. If the IP is valid, check its Class and determine whether the address is Unicast or Multicast. i) 237.15.2.1 ii) 256.1.8.9 iii) 114.34.2.8 iv) 255.254.0.1 v) 8.8.8.8
Find the error of the following IP addresses. If the IP is valid, check its Class and determine whether the address is Unicast or Multicast.i) 237.15.2.1ii) 256.1.8.9iii)...
sanjeet24
125
views
sanjeet24
answered
Mar 5
To see more, click for all the
questions in this category
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register