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
6
votes
1
answer
1891
GO Classes Test Series 2024 | Programming | Test 2 | Question: 23
What will be the output of the program below- int i = 1; void my_extern1(void); void my_extern2(void); int main() { int count = 0; while (i++<5) { static int i = 3; i++; count +=i; my_extern1(); } printf("%d", ... (); } void my_extern2(){ extern int i; if (i++ < 3) my_extern1(); } Infinite recursion $9$ $4$ $5$
What will be the output of the program below-int i = 1; void my_extern1(void); void my_extern2(void); int main() { int count = 0; while (i++<5) { static int i = 3; i++; c...
GO Classes
325
views
GO Classes
asked
Apr 24, 2022
Programming in C
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
recursion
output
2-marks
+
–
0
votes
1
answer
1892
How to find a range of float,double,long in c programming?
How to find a range of float,double,long in c programming? just like we find the range in case of int (signed,unsigned),char (signed ,unsigned) in c programming language ? like integer unsigned range is 0 to 65535 and so on for other data types ? Thank you ahead
How to find a range of float,double,long in c programming? just like we find the range in case of int (signed,unsigned),char (signed ,unsigned) in c programming language ...
ykrishnay
233
views
ykrishnay
asked
Apr 23, 2022
Programming in C
algorithms
programming-in-c
programming
number-system
digital-logic
+
–
5
votes
1
answer
1893
GO Classes 2023 | Weekly Quiz 8 | Question: 2
Consider below four program fragments. Which of the program(s) is/are likely to produce run time error or memory leak. Assume malloc is always successful, and sizes are as follows - sizeof(int *) = 8 bytes sizeof(double) = 8 bytes sizeof(char) = 1 byte sizeof( ... ] = %d\n", a[0], a[1]); return 0; } Program $1$ Program $2$ Program $3$ Program $4$
Consider below four program fragments. Which of the program(s) is/are likely to produce run time error or memory leak. Assume malloc is always successful, and sizes are a...
GO Classes
1.2k
views
GO Classes
asked
Apr 21, 2022
Programming in C
goclasses_wq8
goclasses
programming
programming-in-c
multiple-selects
2-marks
+
–
1
votes
1
answer
1894
time complexity
what is T.C. of this code: for(i=1;i<=n;i++) for(j=1;j<=n;j=j+i) x=x+1;
what is T.C. of this code: for(i=1;i<=n;i++) for(j=1;j<=n;j=j+i) x=x+1;
jugnu1337
473
views
jugnu1337
asked
Apr 20, 2022
DS
time-complexity
+
–
9
votes
1
answer
1895
GO Classes Test Series 2024 | Programming | Test 1 | Question: 6
Consider the $k$ bit binary pattern on 2's complement system. $\text{T}_{\max}$ and $\text{T}_{\min}$ are maximum and minimum signed numbers we can represent using $k$ bits. $\text{U}_{\max}$ and $\text{U}_{\min}$ are maximum and minimum ... $\text{U}_{\min} = !(1>>31)$ $\text{U}_{\max} = \;\sim(1>>31)$
Consider the $k$ bit binary pattern on 2’s complement system.$\text{T}_{\max}$ and $\text{T}_{\min}$ are maximum and minimum signed numbers we can represent using $k$ b...
GO Classes
618
views
GO Classes
asked
Apr 18, 2022
Programming in C
goclasses2024-programming-1-weekly-quiz
goclasses
programming
number-representation
multiple-selects
1-mark
+
–
8
votes
1
answer
1896
GO Classes Test Series 2024 | Programming | Test 1 | Question: 8
What is the output of the following code? Assume that int is $32$ bits, short is $16$ bits, and the representation is two's complement. unsigned int x = 0xDEADBEEF; unsigned short y = 0xFFFF; signed int z = -1; ... Hello"); if (x > z) printf("World"); Prints nothing Prints Hello Prints World Prints HelloWorld
What is the output of the following code? Assume that int is $32$ bits, short is $16$ bits, and the representation is two’s complement.unsigned int x = 0xDEADBEEF; unsi...
GO Classes
545
views
GO Classes
asked
Apr 18, 2022
Programming in C
goclasses2024-programming-1-weekly-quiz
goclasses
programming
programming-in-c
output
2-marks
+
–
9
votes
1
answer
1897
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...
GO Classes
483
views
GO Classes
asked
Apr 18, 2022
Programming in C
goclasses2024-programming-1-weekly-quiz
goclasses
programming
programming-in-c
multiple-selects
2-marks
+
–
9
votes
1
answer
1898
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$
GO Classes
1.1k
views
GO Classes
asked
Apr 18, 2022
Programming in C
goclasses2024-programming-1-weekly-quiz
goclasses
programming
programming-in-c
output
1-mark
+
–
1
votes
1
answer
1899
Applied Root Test Series
Let C(X) be the number of leaves in a binary tree rooted at T. Assume that IsLeaf(T) returns I if T is a leaf. Which of the following observations leads to a recursive implementation? C(T)=C(T.Left) +C(T.Right) C(T):C(T.Left)+C(T.Right)+1 C(T)=C(T.Left]+C(T.right)+Isleaf(T)
Let C(X) be the number of leaves in a binary tree rooted at T. Assume that IsLeaf(T) returns I if T is a leaf. Which of the following observations leads to a recursive im...
Nitesh_Yadav
309
views
Nitesh_Yadav
asked
Apr 12, 2022
Programming in C
recursion
programming-in-c
+
–
5
votes
1
answer
1900
GO Classes 2023 | Weekly Quiz 6 | Question: 2
What will be the output of the following program? #include<stdio.h> main() { int a[2][3][4]; printf("%d", a[1][0]-a[0][2]); }
What will be the output of the following program?#include<stdio.h main() { int a [3][4]; printf("%d", a [0]-a[0] ); }
GO Classes
548
views
GO Classes
asked
Apr 6, 2022
Programming in C
goclasses_wq6
goclasses
programming
programming-in-c
array
output
numerical-answers
2-marks
+
–
4
votes
1
answer
1901
GO Classes 2023 | Weekly Quiz 6 | Question: 9
What will be the output of the following program? #include<stdio.h> void swap(char **s1, char **s2){ char *tmp; tmp=*s1; *s1=*s2; *s2=tmp; } int main() { char *str[3]= {"orange", "apple", "pear"} ... ;%s %s %s", strs[0], strs[1], strs[2]); } pear apple orange apple pear orange orange apple pear apple orange pea
What will be the output of the following program?#include<stdio.h void swap(char s1, char s2){ char *tmp; tmp=*s1; *s1=*s2; *s2=tmp; } int main() { char *str[3]= {"oran...
GO Classes
567
views
GO Classes
asked
Apr 6, 2022
Programming in C
goclasses_wq6
goclasses
programming
programming-in-c
array
array-of-pointers
2-marks
+
–
3
votes
1
answer
1902
GO Classes 2023 | Weekly Quiz 6 | Question: 12
#include<stdio.h> #include<string.h> char upstr[50]; void putStar (int n,char str[]){ upstr[n] = str[n]; if(n == strlen(str)) return; else upstr[n+1] = '*'; putStar(n+1,str); } int main() { char str[] = "hello"; ... %s", upstr); } What will be the output of the given program? h*e*l*l*o h*e*l*l*o* h*e*l*l* hello
#include<stdio.h #include<string.h char upstr[50]; void putStar (int n,char str[]){ upstr[n] = str[n]; if(n == strlen(str)) return; else upstr[n+1] = '*'; putStar(n+1,str...
GO Classes
364
views
GO Classes
asked
Apr 6, 2022
Programming in C
goclasses_wq6
goclasses
programming
programming-in-c
array
2-marks
+
–
3
votes
1
answer
1903
GO Classes 2023 | Weekly Quiz 6 | Question: 13
#include<stdio.h> int bar(int data[], int i, int a, int x) { if (x<0) return 0; x--; int b = a + data[i]; if(data[i] >0) return bar(data, i+1, b, x); if(data[i] == 0 || i ==x-1) return a; return -a; } int main() ... ;data+1)-data; printf("%d", bar(data, 0, 0, x) ); } What will be the output of a given program? $6$ $-6$ $0$ $5$
#include<stdio.h int bar(int data[], int i, int a, int x) { if (x<0) return 0; x ; int b = a + data[i]; if(data[i] >0) return bar(data, i+1, b, x); if(data[i] == 0 || i =...
GO Classes
530
views
GO Classes
asked
Apr 6, 2022
Programming in C
goclasses_wq6
goclasses
programming
programming-in-c
array
2-marks
+
–
0
votes
1
answer
1904
What will be the output and Why?
#include<stdio.h> int main() { char num = '\011'; printf("%d",num); return 0; }
#include<stdio.h int main() { char num = '\011'; printf("%d",num); return 0; }
Anirudh Kaushal
271
views
Anirudh Kaushal
asked
Apr 4, 2022
Programming in C
programming-in-c
+
–
5
votes
1
answer
1905
GO Classes 2023 | Weekly Quiz 4 | Question: 2
Which of the following expressions will evaluate to true? INT_MIN is the minimum signed integer in the system which is using 2's complement representation for signed integers and variables are defined as follows: int x = 5, i = -7; ((x >> 2) << 2) <= x ~ 1&& 1 INT_MIN == -INT_MIN -10 < i <-1
Which of the following expressions will evaluate to true?INT_MIN is the minimum signed integer in the system which is using 2's complement representation for signed integ...
GO Classes
794
views
GO Classes
asked
Mar 26, 2022
Programming in C
goclasses_wq4
goclasses
programming
programming-in-c
number-representation
multiple-selects
2-marks
+
–
1
votes
1
answer
1906
Programming Self Doubt
Suppose we have a 32-bit memory and we have to represent unsigned int a = -5 What will the memory representation look like? 000000…….1011 or 111…..1011
Suppose we have a 32-bit memory and we have to representunsigned int a = -5What will the memory representation look like?000000…….1011or 111…..1011
tusharb
429
views
tusharb
asked
Mar 1, 2022
0
votes
1
answer
1907
CRT-2022
Kindly help
Kindly help
rsansiya111
369
views
rsansiya111
asked
Feb 25, 2022
DS
array
+
–
0
votes
1
answer
1908
CRT-2022
Kindly Help
Kindly Help
rsansiya111
344
views
rsansiya111
asked
Feb 25, 2022
DS
data-structures
+
–
19
votes
1
answer
1909
GATE CSE 2022 | Question: 34
What is printed by the following $\text{ANSI C}$ program? #include<stdio.h> int main(int argc, char *argv[]) { char a = P'; char b = x'; char c = (a&b) + *'; char d = (a|b) - -'; char e = (a^b) + +'; printf( %c %c %c\n , c, d, e); return 0; } ... $\text{z K S}$ $122 \; 75 \; 83$ $ * \; - \; + $ $\text{P x +}$
What is printed by the following $\text{ANSI C}$ program?#include<stdio.h int main(int argc, char *argv[]) { char a = ‘P’; char b = ‘x’; char c = (a&b) + ‘*’;...
Arjun
11.1k
views
Arjun
asked
Feb 15, 2022
Programming in C
gatecse-2022
programming
programming-in-c
output
2-marks
+
–
0
votes
1
answer
1910
CSE Exam 2022
Please Solve anyone
Please Solve anyone
rsansiya111
338
views
rsansiya111
asked
Feb 12, 2022
Programming in C
programming-in-c
+
–
Page:
« prev
1
...
90
91
92
93
94
95
96
97
98
99
100
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register