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
Most answered questions in Programming and DS
0
votes
1
answer
1841
ISI2020-PCB-CS: 1.1
Consider the two $\mathrm{C}$ programs given below. C-CODE (I) #include<stdio.h> int main() { int n=2, *ptr=&n ; n*=3; printf ("%d", (*ptr**ptr)*(*ptr**ptr)); } C-CODE(II) #include<stdio.h> int main() { int n=2, *ptr=&n ; n*=3; ... $1296$ Output of (I) is $1296$ and (II) is $216$ Output of both (I) and (II) is $1296$ None of the above
Consider the two $\mathrm{C}$ programs given below.C-CODE (I)#include<stdio.h int main() { int n=2, *ptr=&n ; n*=3; printf ("%d", (*ptr ptr)*(*ptr ptr)); }C-CODE(II)#incl...
admin
395
views
admin
asked
Aug 8, 2022
Programming in C
isi2020-pcb-cs
programming
programming-in-c
pointers
+
–
4
votes
1
answer
1842
GO Classes Scholarship 2023 | Test | Question: 14
Consider the following C program given below. #include<stdio.h> main() { int a = 4; switch (a) { a--; case 4: printf("Science "); break; default: printf("Technology "); case ... ;Philosophy"); } } What will be the output of the program? Science Knowledge Philosophy Technology Knowledge Philosophy Science Knowledge
Consider the following C program given below.#include<stdio.h main() { int a = 4; switch (a) { a ; case 4: printf("Science "); break; default: printf("Technology "); case...
GO Classes
652
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
output
1-mark
+
–
3
votes
1
answer
1843
GO Classes Scholarship 2023 | Test | Question: 15
Consider Figure $\text{A}$ and Figure $\text{B}$ which represent $4$ bit signed and unsigned numbers respectively in $2's$ complement system. Assume that a few variables are defined below and initialized in such a way that places them in the spot shown in Figure ... of the following(s) is/are true? $s3 > u3$ $s1 > s3$ $u1 > u3$ $s1 > u3$
Consider Figure $\text{A}$ and Figure $\text{B}$ which represent $4$ bit signed and unsigned numbers respectively in $2’s$ complement system.Assume that a few variables...
GO Classes
746
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
number-representation
multiple-selects
2-marks
+
–
5
votes
1
answer
1844
GO Classes Scholarship 2023 | Test | Question: 19
Consider the following declaration of variable a in C program (row-major order). int a[3][4][5]; Which of the following(s) is/are TRUE about pointer arithmetic operations? Value of $a[2]-a[1]$ is $4$ Value of $a[1][2]-a[0][3]$ is $15$ Value of $a[0][10]-a[1][0]$ is $30$ Value of $a[2]-a[1]$ is $5$
Consider the following declaration of variable a in C program (row-major order).int a[3][4][5];Which of the following(s) is/are TRUE about pointer arithmetic operations?V...
GO Classes
770
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
array
multiple-selects
2-marks
+
–
2
votes
1
answer
1845
GO Classes Scholarship 2023 | Test | Question: 20
Consider the following declarations of a few variables. int (*p1)[3]; int (*p2)[3]; int (*t1)[2]; int (*t2)[2]; Let the initial values of $p1, p2, t2$ and $t1$ are $1000, 1036, 2000$ and $2040$ respectively. Consider ... is correct but $\text{S2}$ is incorrect $\text{S2}$ is correct but $\text{S1}$ is incorrect Both are correct Both are incorrect
Consider the following declarations of a few variables.int (*p1)[3]; int (*p2)[3]; int (*t1) ; int (*t2) ;Let the initial values of $p1, p2, t2$ and $t1$ are $1000, 1036,...
GO Classes
592
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
pointers
array-of-pointers
2-marks
+
–
3
votes
1
answer
1846
GO Classes Scholarship 2023 | Test | Question: 21
Let arrays OneD and TwoD are declared as follows as: int OneD[10]; int TwoD[4][5]; Which of the following is/are valid syntax to pass OneD and TwoD to some function fun()? A syntax is valid if it gets compiled without any warning or error. void fun(int OneD[10]); void fun(int OneD[5]); void fun(int TwoD[][5]); void fun(int **TwoD);
Let arrays OneD and TwoD are declared as follows as:int OneD[10]; int TwoD[4][5];Which of the following is/are valid syntax to pass OneD and TwoD to some function fun()?A...
GO Classes
711
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
array
multiple-selects
1-mark
+
–
4
votes
1
answer
1847
GO Classes Scholarship 2023 | Test | Question: 22
Consider below two program fragments. Assume malloc is always successful, and sizes are as follows - sizeof (int *)=8 bytes sizeof ( double)=8 bytes sizeof ( char )=1 byte sizeof ( int )=4 byte Program 1 int **p; p = (int ... run time error, but Program $1$ will run fine. Both programs will always run fine. Both programs may produce run time errors.
Consider below two program fragments.Assume malloc is always successful, and sizes are as follows -sizeof (int *)=8 bytes sizeof ( double)=8 bytes sizeof ( char )=1 byte ...
GO Classes
661
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
pointers
2-marks
+
–
5
votes
1
answer
1848
GO Classes Scholarship 2023 | Test | Question: 23
#include <stdio.h> int main() { int i= 255; short int *s= (short int *)&i; printf("%d\n", *s); } What will be the output of the above program in little-endian and big-endian, respectively? $(65280\text{ is } 255\times2^8)$ $255,\; 0$ $65280,\; 0$ $0,\;0$ $0,\; 65280$
#include <stdio.h int main() { int i= 255; short int *s= (short int *)&i; printf("%d\n", *s); }What will be the output of the above program in little-endian and big-endia...
GO Classes
634
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
number-representation
1-mark
+
–
2
votes
1
answer
1849
GO Classes Scholarship 2023 | Test | Question: 24
Consider the following function $\text{magic5().}$ void magic5(int x, int y){ if (condition) printf("magic"); } What condition we can write in “if-statement” such that $\text{magic5(5,5)}$ will print magic? !(x==5)!=!(y==5) (x==5)?!(y==5):(x==5) ((x==5)||(y==5))&&!((x==5)&&(y==5)) None of these
Consider the following function $\text{magic5().}$void magic5(int x, int y){ if (condition) printf("magic"); }What condition we can write in “if-statement” such that ...
GO Classes
338
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
operators
functions
1-mark
+
–
3
votes
1
answer
1850
GO Classes Scholarship 2023 | Test | Question: 28
What will be the output of the following program? #include<stdio.h> struct _go{ char b[20]; char *a; struct _go *c; }x[2] = {"GATE", "2023", x+1, "GO", "Classes", x}, *p = x; typedef struct_go go; go ... ;c, n-2); } int main() { printf("%s",mystry(p,2023)->a); } GATE $2023$ Run time error GO
What will be the output of the following program?#include<stdio.h struct _go{ char b[20]; char *a; struct _go *c; }x = {"GATE", "2023", x+1, "GO", "Classes", x}, *p = x;...
GO Classes
758
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
structure
recursion
2-marks
+
–
0
votes
1
answer
1851
Recursive function
Consider the following recursive function which is used by dynamic programming. T(n) = { 0; if n<1 1; if n=1 T(n-1)+T(n-2)+1; if n>1} Assume for every function call T(i) it checks the table first , if it's value is ... of 'n' so that overflow cannot occur . ( Assume system allocate 4 byte to each stack entry which is sufficient for storing required data.)
Consider the following recursive function which is used by dynamic programming. T(n) = { 0; if n<1 1; if n=1 T(n-1)+T(n-2)+1; if n>1}Assume ...
Manisha Jaishwal
672
views
Manisha Jaishwal
asked
Aug 6, 2022
Programming in C
recursion
dynamic-programming
+
–
1
votes
1
answer
1852
data structure and algorithms -- linked list -- size of a node
as we allocate the space for node in linked list using malloc() so how many bytes malloc allocate for the 1 node i.e. actual value of malloc allocates in ram like i write this code. so what is size of a node of linked ... node *)malloc(sizeof(struct node)); printf("%d",sizeof(struct node)); } what the printf prints and why ?
as we allocate the space for node in linked list using malloc() so how many bytes malloc allocate for the 1 node i.e. actual value of malloc allocates in ram like i write...
ykrishnay
688
views
ykrishnay
asked
Aug 5, 2022
Programming in C
data-structures
linked-list
algorithms
sorting
+
–
0
votes
1
answer
1853
NIELIT 2021 Dec Scientist B - Section B: 21
What will be the output of the following $\text{ C'}$ ... $3\;\;1\;\;2\;\;2\;\;1\;\;3\;\;4$ $3\;\;1\;\;2\;\;1\;\;1\;\;1\;\;2$
What will be the output of the following $\text{‘C’}$ program?void count(int n) { static int d = 1; printf(" %d", n); printf(" %d", d); d++; if (n>1) count (n - 1); p...
admin
270
views
admin
asked
Jul 21, 2022
Programming in C
nielit-2021-it-dec-scientistb
programming-in-c
+
–
0
votes
1
answer
1854
NIELIT 2021 Dec Scientist B - Section B: 32
Consider the following $\text{C}$ function : int f(int n) { static int i = 1; if (n > = 5) return n; n=n + i;i++; return f(n); } The value returned by $\text{f}(1)$ is : $5$ $6$ $7$ $8$
Consider the following $\text{C}$ function :int f(int n) { static int i = 1; if (n = 5) return n; n=n + i;i++; return f(n); }The value returned by $\text{f}(1)$ is :$5$$...
admin
350
views
admin
asked
Jul 21, 2022
Programming in C
nielit-2021-it-dec-scientistb
+
–
1
votes
1
answer
1855
data structure
Consider a standard Circular Queue ‘q’ implementation (which has the same condition for Queue Full and Queue Empty) whose size is 11 and the elements of the queue are q[1], q[2], ……, q[10]. The front and rear pointer are initialized to point at q[2]. In which position will the ninth element be added?
Consider a standard Circular Queue ‘q’ implementation (which has the same condition for Queue Full and Queue Empty) whose size is 11 and the elements of the queue are...
jugnu1337
541
views
jugnu1337
asked
Jul 17, 2022
DS
data-structures
test-series
+
–
2
votes
1
answer
1856
I am not able to understand how the value of 'i' is 3 after the execution of the program, it must be 2.
#include <stdio.h int main () { int i, j; int a [8] = {1, 2, 3, 4, 5, 6, 7, 8}; for(i = 0; i < 3; i++) { a[i] = a[i] + 1; i++; } i ; for (j = 7; j 4; j ) { int i = j/2; ...
Hrithik Vashishtha
397
views
Hrithik Vashishtha
asked
Jul 4, 2022
Programming in C
programming-in-c
output
+
–
0
votes
1
answer
1857
BigEndian C compiler
Hi, can anyone please suggest me an online site where I can run code in C and test how the code will act under bid endian environment?
Hi, can anyone please suggest me an online site where I can run code in C and test how the code will act under bid endian environment?
yuyutsu
845
views
yuyutsu
asked
Jul 3, 2022
Programming in C
programming-in-c
compiler-design
+
–
0
votes
1
answer
1858
For which of the following does there exist a tree satisfying the specified constraints? (a) A binary tree with 65 leaves and height 6. (b) A binary tree with 33 leaves and height 5.
qweas8671
686
views
qweas8671
asked
Jul 2, 2022
DS
binary-tree
+
–
0
votes
1
answer
1859
Number of max heaps
Someone please explain the login behind the explanation.
Someone please explain the login behind the explanation.
Overflow04
2.2k
views
Overflow04
asked
Jun 29, 2022
DS
ace-test-series
binary-heap
+
–
0
votes
1
answer
1860
Introduction to Alogrithm
Number of max heap possible with n distinct keys.
Number of max heap possible with n distinct keys.
Overflow04
371
views
Overflow04
asked
Jun 29, 2022
DS
data-structures
binary-heap
+
–
Page:
« prev
1
...
88
89
90
91
92
93
94
95
96
97
98
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register