Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Profile
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Answers by shishir__roy
5
votes
91
GO Classes Weekly Quiz 9 | Data Structures | Linked List | Question: 14
Which of the following(s) is/are true? If $f(n) = O(n^2)$ then $f(n) = O(n).$ If $f(n)$ is $O(3^{\log_{10}n}),$ then $f(n)$ is $O(n^2).$ The function $f(n) = \lg(n!) = O(n \lg n).$ Growth of the sum $1 + \frac{1}{2} + \frac{1}{3} + \dots + \frac{1}{n}$ can be described by $\theta(\log n).$
Which of the following(s) is/are true?If $f(n) = O(n^2)$ then $f(n) = O(n).$If $f(n)$ is $O(3^{\log_{10}n}),$ then $f(n)$ is $O(n^2).$The function $f(n) = \lg(n!) = O(n \...
885
views
answered
May 5, 2022
Programming in C
goclasses_wq9
goclasses
algorithms
asymptotic-notation
multiple-selects
2-marks
+
–
5
votes
92
GO Classes Test Series 2024 | Programming | Test 3 | Question: 22
What does the following program print? #include<stdio.h> #include<string.h> struct MdbRec { char name[16]; char msg[24]; }; int main() { struct MdbRec m[1]; strcpy(m[0].name, "dude"); strcpy(m[0].msg, " ... printf("%d", m->msg - (char *)m ); } Prints nothing Prints $17$ Prints $24$ Prints $16$
What does the following program print?#include<stdio.h #include<string.h struct MdbRec { char name[16]; char msg[24]; }; int main() { struct MdbRec m ; strcpy(m[0].name, ...
582
views
answered
May 1, 2022
Programming in C
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
structure
array
multiple-selects
2-marks
+
–
4
votes
93
GO Classes Test Series 2024 | Programming | Test 3 | Question: 29
Mark all options which are likely to create problems with memory, i.e., run time error or have a memory leak. Assume malloc is always successful, and sizes are as follows - sizeof(int *) = 8 bytes sizeof(double) = 8 bytes sizeof(char) = 1 ... 4 int *p = malloc(sizeof(char)); *p = 0; Program $1$ Program $2$ Program $3$ Program $4$
Mark all options which are likely to create problems with memory, i.e., run time error or have a memory leak. Assume malloc is always successful, and sizes are as follows...
610
views
answered
May 1, 2022
Programming in C
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
pointers
multiple-selects
2-marks
+
–
10
votes
94
GO Classes Test Series 2024 | Programming | Test 3 | Question: 30
What will be the output of the following program? It is given that $\textsf{sizeof(int) = 4}$ and $\textsf{sizeof(int *) = 8.}$ #include<stdio.h> main(){ void** p = 1000; int* q = ((int*)(p + 1)) - 1; printf("%u", q); } $1000$ $1008$ $1004$ Error, since $p+1$ is not allowed as $p$ is declared as void.
What will be the output of the following program?It is given that $\textsf{sizeof(int) = 4}$ and $\textsf{sizeof(int *) = 8.}$#include<stdio.h main(){ void p = 1000; int...
356
views
answered
May 1, 2022
Programming in C
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
pointers
2-marks
+
–
4
votes
95
GO Classes Test Series 2024 | Programming | Test 3 | Question: 19
#include<stdio.h> int test(int *a, int *b) { int c = *a-*b; if (c<0) return 0; else return (1 + test(&c, b)); } void main() { int x = 15; int y = 4; int a = test(&x,&y); printf("%d", a); } $2$ $3$ $4$ Run time error since we can not pass the address of local variable c in the function test.
#include<stdio.h int test(int *a, int *b) { int c = *a-*b; if (c<0) return 0; else return (1 + test(&c, b)); } void main() { int x = 15; int y = 4; int a = test(&x,&y); p...
404
views
answered
May 1, 2022
Programming in C
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
functions
pointers
parameter-passing
recursion
2-marks
+
–
4
votes
96
GO Classes Test Series 2024 | Programming | Test 3 | Question: 15
If the $32$-bit number given below is stored in little-endian at address $1000,$ what is the value of the byte at address $1002?$ Answer in decimal. $0001\; 0010 \;0011\; 0100\; 0101\; 0110\; 0111\; 1000$ This number is the same as $12345678$ in hexadecimal.
If the $32$-bit number given below is stored in little-endian at address $1000,$ what is the value of the byte at address $1002?$ Answer in decimal.$$0001\; 0010 \;0011\;...
439
views
answered
May 1, 2022
Programming in C
goclasses2024-programming-3-weekly-quiz
numerical-answers
goclasses
programming
programming-in-c
number-representation
2-marks
+
–
2
votes
97
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)...
425
views
answered
Apr 26, 2022
Programming in C
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
recursion
output
2-marks
+
–
14
votes
98
GO Classes Test Series 2024 | Programming | Test 1 | Question: 25
What will be the output of the following C program? #include<stdio.h> void main() { int a =0; int b = (a-- ? a++: a ? a++ : a-- ); printf("%d", b); } $0$ $-1$ $-2$ $2$
What will be the output of the following C program?#include<stdio.h void main() { int a =0; int b = (a ? a++: a ? a++ : a ); printf("%d", b); }$0$$-1$$-2$$2$
1.1k
views
answered
Apr 18, 2022
Programming in C
goclasses2024-programming-1-weekly-quiz
goclasses
programming
programming-in-c
output
1-mark
+
–
7
votes
99
GO Classes Test Series 2024 | Programming | Test 1 | Question: 22
Consider the following C code. Where $x$ and $y$ are unknown integers and have been initialized to values greater than $1.$ int i=1, j=0; while (i<y) { j = j+i; i = i+1; if(i==x) break; } Which of the following statement(s) about the variables $i$ and ... then $i = y-1$ $(j=y(y+1)/2 \wedge (i=y)) \vee ((j=x(x+1)/2)\wedge (i = x))$
Consider the following C code. Where $x$ and $y$ are unknown integers and have been initialized to values greater than $1.$int i=1, j=0; while (i<y) { j = j+i; i = i+1; i...
494
views
answered
Apr 18, 2022
Programming in C
goclasses2024-programming-1-weekly-quiz
goclasses
programming
programming-in-c
multiple-selects
2-marks
+
–
Page:
« prev
1
2
3
4
5
6
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register