Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Recent questions and answers in Programming and DS
37
votes
11
answers
1
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$
Subham640
answered
in
Programming in C
21 hours
ago
by
Subham640
29.8k
views
gatecse-2021-set2
programming-in-c
array
output
1-mark
45
votes
8
answers
2
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$
Subham640
answered
in
Programming in C
1 day
ago
by
Subham640
15.8k
views
gatecse-2015-set3
programming
programming-in-c
normal
array
0
votes
0
answers
3
GATE 2024 CSE1
I have a question that can we use command line arguments without main function arguments? int main(int argc, char **argv){ }
RahulVerma3
asked
in
Programming in C
2 days
ago
by
RahulVerma3
56
views
gatecse2024-set1
programming-in-c
1
vote
1
answer
4
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?
Ajay12345
answered
in
DS
3 days
ago
by
Ajay12345
232
views
drdocse-2022-paper1
data-structures
binary-tree
4-marks
descriptive
0
votes
1
answer
5
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?
teja1521
answered
in
Programming in C
Mar 11
by
teja1521
197
views
numerical-answers
algorithms
2
votes
2
answers
6
let x be an array of integer which of the following can not be present in the LHS of an assignment statement
teja1521
answered
in
Programming in C
Mar 11
by
teja1521
2.6k
views
1
vote
3
answers
7
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$
ajayraho
answered
in
DS
Mar 11
by
ajayraho
1.6k
views
ugcnetcse-dec2004-paper2
1
vote
1
answer
8
DRDO CSE 2022 Paper 1 | Question: 26 (b)
Provide the correct data structures for the following: Asynchronous data transfer and accessing shared resource involve _________.
mishraamulya
answered
in
DS
Mar 10
by
mishraamulya
318
views
drdocse-2022-paper1
data-structures
1-mark
fill-in-the-blanks
1
vote
1
answer
9
Array
Does C support fractional Indices? float x = some fraction; Is float a[x] valid declaration?
teja1521
answered
in
Programming in C
Mar 8
by
teja1521
119
views
array
programming-in-c
1
vote
2
answers
10
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”
teja1521
answered
in
Programming in C
Mar 8
by
teja1521
354
views
uppcl2018
programming
programming-in-c
output
2
votes
3
answers
11
Made Easy Mock -1
how does the program is working..? answer – 8
teja1521
answered
in
Programming in C
Mar 8
by
teja1521
376
views
programming
numerical-answers
made-easy-test-series
6
votes
3
answers
12
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
teja1521
answered
in
Programming in C
Mar 8
by
teja1521
356
views
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
recursion
output
2-marks
1
vote
3
answers
13
GATE CSE 2024 | Set 1 | Question: 9
Consider the following $\mathrm{C}$ program: #include <stdio.h> void fX () { void fX () ; char a; int main() { if ((a=g e t c h a r()) ! = '\n') fX}() ; fX(); return 0 ; if (a ! = '\n ... The 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
shah___
answered
in
Programming in C
Mar 6
by
shah___
2.6k
views
gatecse2024-set1
programming
programming-in-c
0
votes
1
answer
14
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
sanjeet24
answered
in
Programming in C
Mar 5
by
sanjeet24
72
views
2
votes
2
answers
15
find the output
include <stdio.h> int main() { int a[][3] = {1, 2, 3, 4, 5, 6}; int (*ptr)[3] = a; printf("%d %d ", (*ptr)[1], (*ptr)[2]); ++ptr; printf("%d %d\n", (*ptr)[1], (*ptr)[2]); return 0; } (a) 2 3 5 6 (b) 2 3 4 5 (c) 4 5 0 0 (d) none of the above
ritiksri8
answered
in
Programming in C
Mar 5
by
ritiksri8
5.8k
views
programming-in-c
0
votes
0
answers
16
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
Emankashyap
asked
in
Programming in C
Mar 1
by
Emankashyap
107
views
0
votes
1
answer
17
c programming
#include <stdio.h> int main() { int i = -1; int x = (unsigned char)i; printf("%d", x); return 0; } output is 255 , but please explain how
AniMan_7
answered
in
Programming in C
Feb 29
by
AniMan_7
179
views
programming-in-c
2
votes
2
answers
18
GATE CSE 2024 | Set 2 | Question: 3
Consider the following $\text{C}$ program. Assume parameters to a function are evaluated from right to left. #include <stdio.h> int g( int p) { printf("%d", p); return p; } int h(i nt q) { printf("%d", q) ... one of the following options is the CORRECT output of the above $\text{C}$ program? $20101020$ $10202010$ $20102010$ $10201020$
AniMan_7
answered
in
Programming in C
Feb 28
by
AniMan_7
3.1k
views
gatecse2024-set2
programming
programming-in-c
68
votes
13
answers
19
GATE CSE 2017 Set 2 | Question: 55
Consider the following C program. #include<stdio.h> #include<string.h> int main() { char* c="GATECSIT2017"; char* p=c; printf("%d", (int)strlen(c+2[p]-6[p]-1)); return 0; } The output of the program is _______
B Bhatta
answered
in
Programming in C
Feb 28
by
B Bhatta
27.3k
views
gatecse-2017-set2
programming-in-c
numerical-answers
array
pointers
59
votes
4
answers
20
GATE CSE 2014 Set 2 | Question: 40
Consider the following function. double f(double x){ if( abs(x*x - 3) < 0.01) return x; else return f(x/2 + 1.5/x); } Give a value $q$ (to $2$ decimals) such that $f(q)$ will return $q$:_____.
B Bhatta
answered
in
Programming in C
Feb 26
by
B Bhatta
16.4k
views
gatecse-2014-set2
programming
recursion
numerical-answers
normal
0
votes
1
answer
21
Linked List
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
answered
in
Programming in C
Feb 26
by
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
125
views
linked-list
data-structures
algorithms
1
vote
0
answers
22
I have purchased the IIIT Hyderabad 2024 test series but i can't find the test series anywhere
Khushbu Chaudhary
asked
in
Programming in C
Feb 25
by
Khushbu Chaudhary
74
views
9
votes
3
answers
23
GO Classes Test Series 2024 | Programming | Test 1 | Question: 24
What will be the output of the following C program? Assume that negative numbers are represented using $2’s$ complement. #include<stdio.h> void main() { int a = 2; a = ~a+2 << 1; printf("%d",a); }
ritiksri8
answered
in
Programming in C
Feb 25
by
ritiksri8
910
views
goclasses2024-programming-1-weekly-quiz
numerical-answers
goclasses
programming
programming-in-c
output
1-mark
3
votes
2
answers
24
GO Classes Test Series 2024 | Programming | Test 3 | Question: 23
What will be the output of the following lines of code? int i = 0; int j = 0; char *s = "ceded"; while (s[i] != '\0') { j = j + s[i] - 'b'; i = i + 1; } printf("%d %d\n", i, j); $5\; 11$ $4\; 16$ $5\; 16$ $4 \;11$
ritiksri8
answered
in
Programming in C
Feb 25
by
ritiksri8
262
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
loop
output
2-marks
6
votes
3
answers
25
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}$
ritiksri8
answered
in
Programming in C
Feb 25
by
ritiksri8
948
views
goclasses_wq2
goclasses
programming
programming-in-c
output
1-mark
4
votes
3
answers
26
GO Classes Scholarship 2023 | Test | Question: 16
Consider the following declaration of variables $a$ and $b.$ int a = 1, b = 0; Which of the following is/are will evaluate to TRUE? b++ && b == a b++ && a == 0 a || b == --a a || ++b == 0
ritiksri8
answered
in
Programming in C
Feb 25
by
ritiksri8
662
views
goclasses-scholarship-test1
goclasses
programming
programming-in-c
multiple-selects
2-marks
7
votes
2
answers
27
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 33
On a $64$-bit system, which of the following C expressions is equivalent to the C expression $(x[2]+4)[3]?$ Assume $\mathrm{x}$ is declared as $\textsf{int}\ast \ast \textsf{x}$ $\ast((*(x+16))+28)$ $\ast((*(x+2))+7)$ $\ast(((* x)+2)+7)$ $(* \ast(x+2)+7)$
teja1521
answered
in
Programming in C
Feb 25
by
teja1521
408
views
goclasses2024-mockgate-14
programming
programming-in-c
pointers
1-mark
1
vote
2
answers
28
Pointers
Main() { char far *s1,*s2; Printf("%d%d",size of(s1),sizeof(s2)); }
ritiksri8
answered
in
Programming in C
Feb 24
by
ritiksri8
662
views
24
votes
2
answers
29
GATE CSE 2006 | Question: 77
Statement for Linked Answer Questions 76 & 77: A $3$-ary max heap is like a binary max heap, but instead of $2$ children, nodes have $3$ children. A $3$-ary heap can be represented by an array as follows: The root is stored in the first location, $a[0]$, nodes in the next level, from left to ... $10, 9, 4, 5, 7, 6, 8, 2, 1, 3$ $10, 8, 6, 9, 7, 2, 3, 4, 1, 5$
Maddy_dahiphale
answered
in
DS
Feb 23
by
Maddy_dahiphale
7.3k
views
gatecse-2006
data-structures
binary-heap
normal
7
votes
2
answers
30
Test by Bikram | Programming | Test 2 | Question: 16
What will be the output of this program ? #define square(x) x*x main() { int z; z = 25/square(5); printf("%d",z); }
ritiksri8
answered
in
Programming in C
Feb 22
by
ritiksri8
335
views
tbb-programming-2
numerical-answers
1
vote
2
answers
31
Functions and storage classes, Gate Wallah Practice Sheet,
I am getting (b) 5 ?? Can you please explain the_ int i_ in for loop and display() [MCQ] 44. Consider the following function: void display() { static int i; if(i<=printf("GATE24")) { i=i+2; display(); } } int main() { int i=0; ... ;3;i++) display(); return 0; } The number of times printf() executed is- (a) 6 (b) 5 (c) 7 (d) 9
ritiksri8
answered
in
Programming in C
Feb 21
by
ritiksri8
555
views
programming-in-c
storage-classes-in-c
46
votes
5
answers
32
GATE CSE 2018 | Question: 29
#include<stdio.h> void fun1(char* s1, char* s2){ char* temp; temp = s1; s1 = s2; s2 = temp; } void fun2(char** s1, char** s2){ char* temp; temp = *s1; *s1 = *s2; *s2 = temp; } int main(){ char *str1="Hi", *str2 = "Bye"; fun1 ... of the program above is: $\text{Hi Bye Bye Hi}$ $\text{Hi Bye Hi Bye}$ $\text{Bye Hi Hi Bye}$ $\text{Bye Hi Bye Hi}$
ritiksri8
answered
in
Programming in C
Feb 19
by
ritiksri8
14.9k
views
gatecse-2018
programming-in-c
pointers
parameter-passing
normal
programming
2-marks
2
votes
2
answers
33
GATE CSE 2024 | Set 2 | Question: 26
What is the output of the following $\text{C}$ program? #include <stdio.h> int main() { double $a[2]=\{20.0,25.0\},{ }^{*} \mathrm{p},{ }^{*} \mathrm{q}$; $\mathrm{p}=\mathrm{a} ;$ $q=p+1 ;$ printf("%d,%d", (int) $(q-p),($ int $\left.)\left({ }^{*} q-{ }^{*} p\right)\right)$; return $0$ ; } $4,8$ $1,5$ $8,5$ $1,8$
1mohitpl
answered
in
Programming in C
Feb 19
by
1mohitpl
2.4k
views
gatecse2024-set2
programming
programming-in-c
0
votes
2
answers
34
GATE CSE 2024 | Set 1 | Question: 33
Consider a binary min-heap containing $105$ distinct elements. Let $k$ be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of $k$ is $53$ $52$ $27$ $1$
Swarnava Bose
answered
in
DS
Feb 18
by
Swarnava Bose
1.8k
views
gatecse2024-set1
data-structures
0
votes
1
answer
35
GATE DS&AI 2024 | Question: 11
Consider performing uniform hashing on an open address hash table with load factor $\alpha=\frac{n}{m}<1$, where $n$ elements are stored in the table with $m$ slots. The expected number of probes in an unsuccessful search is at most $\frac{1}{1-\alpha}$. Inserting ... $\frac{1}{1-\alpha}$ $1+\frac{\alpha}{2}$ $\frac{1}{1+\alpha}$
liontig37
answered
in
DS
Feb 18
by
liontig37
651
views
gate-ds-ai-2024
data-structures
hashing
uniform-hashing
0
votes
2
answers
36
GATE DS&AI 2024 | Question: 31
Consider the following Python function: def $\operatorname{fun}(D, s 1, s 2)$ : if $\mathrm{s} 1
ankitgupta.1729
answered
in
Programming in Python
Feb 17
by
ankitgupta.1729
827
views
gate-ds-ai-2024
programming
0
votes
1
answer
37
GATE DS&AI 2024 | Question: 28
Consider the following Python code: def count(child_dict, i): if i not in child_dict.keys(): return 1 ans $=1$ for $j$ in child_dict[i]: ans $+=$ count (child_dict, j) return ans child_dict $=$ dict () child_dict $[0]=[1,2]$ child_dict $[1]=[3,4,5]$ ... $)$ ) Which ONE of the following is the output of this code? $6$ $1$ $8$ $9$
Anmol Verma
answered
in
Programming in Python
Feb 17
by
Anmol Verma
758
views
gate-ds-ai-2024
programming
1
vote
1
answer
38
GATE CSE 2024 | Set 2 | Question: 38
Let $\mathrm{S} 1$ and $\mathrm{S} 2$ be two stacks. $\mathrm{S} 1$ has capacity of $4$ elements. $\mathrm{S} 2$ has capacity of $2$ elements. $\text{S1}$ already has $4$ elements: $100,200,300$, and $400$ ... output sequences can be generated by using the above operations? $100,200,400,300$ $200,300,400,100$ $400,200,100,300$ $300,200,400,100$
Hira Thakur
answered
in
DS
Feb 17
by
Hira Thakur
1.6k
views
gatecse2024-set2
data-structures
stack
multiple-selects
3
votes
3
answers
39
GATE CSE 2024 | Set 1 | Question: 8
Consider the following $\mathrm{C}$ program: #include <stdio.h> int main() { int a=6; int b = 0; while (a<10) { a = a / 12+1 ; a += b ;} printf ("%d", a); return 0 ; } Which one of the following ... The program prints $9$ as output The program prints $10$ as output The program gets stuck in an infinite loop The program prints $6$ as output
TusharRana
answered
in
Programming in C
Feb 17
by
TusharRana
5.4k
views
gatecse2024-set1
programming
programming-in-c
3
votes
2
answers
40
GATE CSE 2024 | Set 2 | Question: 32
Consider an array $\mathrm{X}$ that contains $\mathrm{n}$ positive integers. A subarray of $\mathrm{X}$ is defined to be a sequence of array locations with consecutive indices. The $\mathrm{C}$ code snippet given below has been written to compute the length of the longest ... $\text{(P) } \text{len} 2+1$ $\text{(Q) } \text{len} 1+1$
thehitchh1ker
answered
in
Programming in C
Feb 17
by
thehitchh1ker
1.6k
views
gatecse2024-set2
programming
programming-in-c
To see more, click for all the
questions in this category
.
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Programming
(4.1k)
DS
(2.0k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(683)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
243k
comments
79.7k
users
Recent questions and answers in Programming and DS
Recent Blog Comments
Hlo I'm Rupesh I got AIR 3485 in gate CS and AIR...
@Ajay Sasank here is the direct link...
Thank you for the post didi My GATE 2023 & 2024...
I Hope it helps 😊
Today's best post I seen thank you for motivation