Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Programming:
Recent questions tagged programming
2
votes
0
answers
181
igate test series
AVL tree is binary search tree with additional property that difference between height of left sub-tree and right sub-tree of any node can’t be more than 1 if n is the number of nodes in a AVL tree . The maximum value of n for which the difference between the minimum height and maximum height of AVL tree is <2 _________ ?
AVL tree is binary search tree with additional property that difference between height of left sub-tree and right sub-tree of any node can’t be more than 1 if n is the ...
jugnu1337
479
views
jugnu1337
asked
Nov 1, 2022
DS
i-gate-test-series
programming
binary-search-tree
avl-tree
+
–
0
votes
0
answers
182
Consider the following class definitions in a hypothetical Object Oriented language that supports inheritance and uses dynamic binding. The language should not be assumed to be either Java or C++, though the syntax is similar. Class P { void f(int i) { print(i); } } Class Q subclass of P { void f(int i) { print(2*i); } } Now consider the following program fragment: P x = new Q(); Q y = new Q(); P z = new Q(); x.f(1); ((P)y).f(1); z.f(1); Here ((P)y) denotes a typecast of y to P. The output produced by executing the above program fragment will be (A) 1 2 1 (B) 2 1 1 (C) 2 1 2 (D) 2 2 2
Jeetmoni saikia
564
views
Jeetmoni saikia
asked
Oct 10, 2022
Programming in C
programming
object-oriented-programming
+
–
1
votes
1
answer
183
DOUBT
DOUBT: suppose a memory space of 16B is given and it is asked that what is the maximum length of string it can store. then do we have to consider the space taken by the “\0” also? OR just the string length?
DOUBT:suppose a memory space of 16B is given and it is asked that what is the maximum length of string it can store.then do we have to consider the space taken by the �...
Pranavpurkar
329
views
Pranavpurkar
asked
Sep 27, 2022
Programming in C
programming
strings
+
–
1
votes
1
answer
184
ISI2020-PCB-CS: 1.2
What will be the output of the following C program? Justify your answer. Negative numbers are represented in $2$'s complement, #include<stdio.h> int main() { if (-~-1) printf("COVID"); if ((~7 & Ox000f ) == 8) printf (“19”); printf ("*"); }
What will be the output of the following C program? Justify your answer. Negative numbers are represented in $2$'s complement,#include<stdio.h int main() { if (-~-1) prin...
admin
440
views
admin
asked
Aug 18, 2022
Programming in C
isi2020-pcb-cs
programming
programming-in-c
number-representation
descriptive
+
–
1
votes
1
answer
185
ISI 2021 | PCB CS | Question: 4
Let $A$ be a matrix of size row $\times$ col. $A$ has to be filled in a spiral clockwise fashion with successive integers from $1,2, \ldots$, row $\times$ col starting from the top left corner. For example, a $3 \times 4$ ... (int *)); for(i=0;i<row;i++){ A[i] = (int *)calloc(col,sizeof(int)); } spiralFill(A,row,col); }
Let $A$ be a matrix of size row $\times$ col. $A$ has to be filled in a spiral clockwise fashion with successive integers from $1,2, \ldots$, row $\times$ col starting fr...
admin
511
views
admin
asked
Aug 8, 2022
Programming in C
isi2021-pcb-cs
programming
programming-in-c
functions
matrix
descriptive
+
–
0
votes
1
answer
186
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
372
views
admin
asked
Aug 8, 2022
Programming in C
isi2020-pcb-cs
programming
programming-in-c
pointers
+
–
4
votes
1
answer
187
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
624
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
188
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
724
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
number-representation
multiple-selects
2-marks
+
–
4
votes
3
answers
189
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
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 == ab++ && a == 0a || b == aa |...
GO Classes
679
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
multiple-selects
2-marks
+
–
5
votes
3
answers
190
GO Classes Scholarship 2023 | Test | Question: 17
Consider the following pair of mutually recursive functions. int f(int n){ if (n==0) return 1; return f(n-1)+g(n-1); } int g(int n){ if (n==0) return 1; return g(n-1) - f(n); } Which of the following is/are will evaluate to TRUE? $f(2) == g(0)$ $g(2)+f(1) == 0$ $g(4)+g(1) == 0$ $f(3)+f(0) == 0$
Consider the following pair of mutually recursive functions.int f(int n){ if (n==0) return 1; return f(n-1)+g(n-1); } int g(int n){ if (n==0) return 1; return g(n-1) - f(...
GO Classes
616
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
functions
recursion
multiple-selects
2-marks
+
–
4
votes
2
answers
191
GO Classes Scholarship 2023 | Test | Question: 18
Consider the following declaration of pointer variable $p.$ int (*p)[10][5]; If the initial value of $p$ is $1000,$ then what will be the value of $p+1?$ It is given that system has $8$ bytes of address size and $4$ bytes of integer size.
Consider the following declaration of pointer variable $p.$int (*p)[10][5];If the initial value of $p$ is $1000,$ then what will be the value of $p+1?$It is given that sy...
GO Classes
835
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
numerical-answers
goclasses
array-of-pointers
programming
programming-in-c
pointers
1-mark
+
–
5
votes
1
answer
192
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
739
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
193
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
524
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
194
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
684
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
195
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
635
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
196
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
615
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
197
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
322
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
operators
functions
1-mark
+
–
3
votes
3
answers
198
GO Classes Scholarship 2023 | Test | Question: 25
Consider struct alignment rules as described below - Each primitive data (int, char, float, etc.) type requiring $\text{K}$ bytes must be stored at the address must be multiple of $\text{K}.$ ... a [5]; long int b; } What will be $\text{sizeof(struct s)}?$ $24$ $18$ $32$ $20$
Consider struct alignment rules as described below –Each primitive data (int, char, float, etc.) type requiring $\text{K}$ bytes must be stored at the address must be m...
GO Classes
479
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
goclasses
programming
programming-in-c
structure
2-marks
+
–
3
votes
3
answers
199
GO Classes Scholarship 2023 | Test | Question: 26
What will be the output of the following C program? int sum = 0; for (int i = 1; i <= 10; i++) for (int j = 1; j <= 10; j++){ sum += i * j; }
What will be the output of the following C program?int sum = 0; for (int i = 1; i <= 10; i++) for (int j = 1; j <= 10; j++){ sum += i * j; }
GO Classes
413
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
numerical-answers
goclasses
programming
programming-in-c
output
2-marks
+
–
2
votes
3
answers
200
GO Classes Scholarship 2023 | Test | Question: 27
What will be the number of recursive calls for $\textsf{mystery(5)}$ including the first call? void mystery(int n) { if (n == 0 || n == 1) return 0; mystery(n-2); printf("%d", n); mystery(n-1); }
What will be the number of recursive calls for $\textsf{mystery(5)}$ including the first call?void mystery(int n) { if (n == 0 || n == 1) return 0; mystery(n-2); printf("...
GO Classes
542
views
GO Classes
asked
Aug 6, 2022
Programming in C
goclasses-scholarship-test1
numerical-answers
goclasses
programming
programming-in-c
recursion
1-mark
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
11
12
...
32
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register