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
1
votes
1
answer
1
Gate Wallah DPP
Consider the following function: int arc(int i, int j) { if(i<2) return j+2; else if(j<2) return arc(i-1, 1); else return arc(i-1, arc(i, j-2)); } The value returned by arc(2, 6) is _________
Consider the following function:int arc(int i, int j){if(i<2) return j+2;else if(j<2) return arc(i-1, 1);else return arc(i-1, arc(i, j-2));}The value returned by arc(2, 6...
Khushboo Solanki
47
views
Khushboo Solanki
asked
2 days
ago
Programming in C
programming-in-c
numerical-answers
+
–
0
votes
1
answer
2
Functions
Consider the following function: int arc(int i, int j) { if(i<2) return j+2; else if(j<2) return arc(i-1, 1); else return arc(i-1, arc(i, j-2)); } The value returned by arc(2, 6) is ____________
Consider the following function:int arc(int i, int j){if(i<2) return j+2;else if(j<2) return arc(i-1, 1);else return arc(i-1, arc(i, j-2));}The value returned by arc(2, 6...
Khushboo Solanki
36
views
Khushboo Solanki
asked
2 days
ago
Programming in C
functions
+
–
0
votes
0
answers
3
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 another array of same size, if it's address of 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
60
views
srijankarak_123
asked
May 7
Programming in C
programming-in-c
array
+
–
0
votes
0
answers
4
i am not able to give test
arjun1947
27
views
arjun1947
asked
May 5
0
votes
0
answers
5
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...
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
55
views
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
asked
May 5
1
votes
2
answers
6
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...
Ayush_Pal
172
views
Ayush_Pal
asked
Apr 26
Programming in C
ace-test-series
+
–
1
votes
1
answer
7
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
177
views
piyush512
asked
Apr 20
DS
array
data-structures
+
–
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...
Debargha Mitra Roy
155
views
Debargha Mitra Roy
asked
Apr 16
Programming in C
array
data-structures
programming-in-c
+
–
0
votes
0
answers
9
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
200
views
Debargha Mitra Roy
asked
Apr 12
Programming in C
programming-in-c
operator-precedence
boolean-algebra
+
–
1
votes
1
answer
10
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...
Pradeep kori 73
103
views
Pradeep kori 73
asked
Apr 11
0
votes
2
answers
11
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
Debargha Mitra Roy
180
views
Debargha Mitra Roy
asked
Apr 10
Programming in C
recursion
programming-in-c
programming
+
–
1
votes
1
answer
12
#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...
sumitkumarsethi
124
views
sumitkumarsethi
asked
Apr 8
Programming in C
recursion
functions
+
–
3
votes
0
answers
13
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
172
views
RahulVerma3
asked
Mar 22
Programming in C
programming-in-c
programming
+
–
0
votes
0
answers
14
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
167
views
RahulVerma3
asked
Mar 16
Programming in C
programming-in-c
usergate2024
+
–
0
votes
1
answer
15
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; ...
Emankashyap
215
views
Emankashyap
asked
Mar 1
2
votes
1
answer
16
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
#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
SSR17
297
views
SSR17
asked
Feb 29
Programming in C
programming-in-c
+
–
1
votes
0
answers
17
I have purchased the IIIT Hyderabad 2024 test series but i can't find the test series anywhere
Khushbu Chaudhary
112
views
Khushbu Chaudhary
asked
Feb 25
0
votes
1
answer
18
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.
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
Mrityudoot
202
views
Mrityudoot
asked
Feb 25
Programming in C
linked-list
data-structures
algorithms
+
–
0
votes
1
answer
19
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)...
Sheikh Rafi
133
views
Sheikh Rafi
asked
Feb 24
0
votes
2
answers
20
GATE DS&AI 2024 | Question: 6
Match the items in Column $1$ with the items in Column $2$ in the following table: \begin{array}{|ll|ll|} \hline & \text{Column 1} & & \text{Column 2} \\ \hline \text{(p)} & \text{First In First Out} & \text{(i)} & \text{ ... $(\mathrm{p})-(\mathrm{i}),(\mathrm{q})-(\mathrm{iii}),(\mathrm{r})-(\mathrm{ii})$
Match the items in Column $1$ with the items in Column $2$ in the following table:\begin{array}{|ll|ll|}\hline & \text{Column 1} & & \text{Column 2} \\\...
Arjun
853
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
data-structures
match-the-following
+
–
Page:
1
2
3
4
5
6
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register