Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Programming:
Recent questions tagged programming
1
votes
2
answers
451
Zeal Test Series 2018: Programming & DS - Programming In C
Prince Sindhiya
1.1k
views
Prince Sindhiya
asked
Dec 22, 2018
Programming in C
zeal
programming
programming-in-c
zeal2018
+
–
0
votes
0
answers
452
Zeal Test Series 2019: Programming & DS - Programming In C
i have not read lvalue is it there in syllabus and how to do this
i have not read lvalue is it there in syllabus and how to do this
Prince Sindhiya
526
views
Prince Sindhiya
asked
Dec 21, 2018
Programming in C
programming
programming-in-c
zeal2019
zeal
+
–
0
votes
0
answers
453
Self Doubt
Please correct if any of the point is wrong : Quicksort: 1.Need more random accesses 2 Used when Random access is fast (hence preferred on array and not on Linked List) 2 No extra space needed ==> Inplace 4 Not a stable sorting algorithm ... : Quicksort in particular exhibits good cache locality and this makes it faster than merge sort in many cases like in virtual memory environment.
Please correct if any of the point is wrong :Quicksort:1.Need more random accesses2 Used when Random access is fast (hence preferred on array and not on Linked List)2 No ...
jatin khachane 1
817
views
jatin khachane 1
asked
Dec 21, 2018
Programming in C
programming
data-structures
sorting
+
–
12
votes
3
answers
454
TIFR CSE 2019 | Part B | Question: 6
Given the following pseudocode for function $\text{printx()}$ below, how many times is $x$ printed if we execute $\text{printx(5)}?$ void printx(int n) { if(n==0){ printf(“x”); } for(int i=0;i<=n-1;++i){ printx(n-1); } } $625$ $256$ $120$ $24$ $5$
Given the following pseudocode for function $\text{printx()}$ below, how many times is $x$ printed if we execute $\text{printx(5)}?$void printx(int n) { if(n==0){ printf...
Arjun
2.5k
views
Arjun
asked
Dec 18, 2018
Programming in C
tifr2019
programming
programming-in-c
+
–
5
votes
2
answers
455
TIFR CSE 2019 | Part B | Question: 8
Consider the following program fragment: var a,b : integer; procedure G(c,d: integer); begin c:=c-d; d:=c+d; c:=d-c end; a:=2; b:=3; G(a,b); If both parameters to $G$ are passed by reference, what are the values of $a$ and $b$ at the end of the above program fragment ? $a=0$ and $b=2$ $a=3$ and $b=2$ $a=2$ and $b=3$ $a=1$ and $b=5$ None of the above
Consider the following program fragment:var a,b : integer; procedure G(c,d: integer); begin c:=c-d; d:=c+d; c:=d-c end; a:=2; b:=3; G(a,b);If both parameters to $G$ are p...
Arjun
2.0k
views
Arjun
asked
Dec 18, 2018
Programming in C
tifr2019
programming
parameter-passing
+
–
12
votes
2
answers
456
TIFR CSE 2019 | Part B | Question: 9
Consider the following program fragment: var x, y: integer; x := 1; y := 0; while y < x do begin x := 2*x; y := y+1 end; For the above fragment , which of the following is a loop invariant ? $x=y+1$ $x=(y+1)^2$ $x=(y+1)2^y$ $x=2^y$ None of the above, since the loop does not terminate
Consider the following program fragment:var x, y: integer; x := 1; y := 0; while y < x do begin x := 2*x; y := y+1 end;For the above fragment , which of the following is ...
Arjun
3.6k
views
Arjun
asked
Dec 18, 2018
Programming in C
tifr2019
programming
loop-invariants
+
–
1
votes
1
answer
457
Zeal Test Series 2019: Programming & DS - Programming In C
The value of z after the execution of the following program is void f(int x) { staticint z; z=z+x; } int main() { int y=10; fork(); fork(); f(y); return 0; } 1.30 2.20 3.40 4. 10
The value of z after the execution of the following program isvoid f(int x) {staticint z;z=z+x;}int main() {int y=10;fork();fork();f(y);return 0;}1.30 2.20 3.40 4. 10
Prince Sindhiya
850
views
Prince Sindhiya
asked
Dec 16, 2018
Programming in C
zeal
programming
programming-in-c
zeal2019
+
–
0
votes
1
answer
458
Gateforum Test Series: Programming & DS - Programming In C
Can anyone explain how will the second parameter gets passed ?
Can anyone explain how will the second parameter gets passed ?
Shivam Kasat
596
views
Shivam Kasat
asked
Dec 15, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
4
votes
2
answers
459
What is the return value of following function for 484? What does it to in general?
What is the return value of following function for 484? What does it to in general? bool fun(int n) { int sum = 0; for (int odd = 1; n > sum; odd = odd+2) sum = sum + odd; return (n == sum ... is odd or not (D) True, it checks whether a given number is perfect square. Any one can explain output of above program?
What is the return value of following function for 484? What does it to in general?bool fun(int n){ int sum = 0; for (int odd = 1; n sum; odd = odd+2) sum = ...
Gangani_Son
2.2k
views
Gangani_Son
asked
Dec 14, 2018
Programming in C
programming-in-c
functions
programming
loop
+
–
2
votes
1
answer
460
output of the program
#include <stdio.h> void print(int n, int j) { if (j >= n) return; if (n-j > 0 && n-j >= j) printf("%d %dn", j, n-j); print(n, j+1); } int main() { int n = 8; print(n, 1); } (A) 1 7 2 6 3 5 4 4 4 4 (B) 1 7 2 6 3 5 4 4 (C) 1 7 2 6 3 5 (D) 1 2 3 4 5 6 7 8 Answer is B. anyone can explain how?
#include <stdio.h void print(int n, int j){ if (j >= n) return; if (n-j 0 && n-j >= j) printf("%d %dn", j, n-j); print(n, j+1);} int main(){ int n = ...
Gangani_Son
7.4k
views
Gangani_Son
asked
Dec 11, 2018
Programming in C
programming-in-c
programming
recursion
+
–
3
votes
2
answers
461
MadeEasy Subject Test 2019: Programming & DS - Programming In C
char *a = “MADEEASY”; char *b = “GATECSIT2019”; char *r = a; char *s = b; printf(“%d”, (int) strlen (b+3[r] – 1[s])); return 0; Whats the output? Answer given 8
char *a = “MADEEASY”;char *b = “GATECSIT2019”;char *r = a;char *s = b;printf(“%d”, (int) strlen (b+3[r] – 1[s]));return 0; Whats the output? Answer given 8
Shamim Ahmed
594
views
Shamim Ahmed
asked
Dec 11, 2018
Programming in C
made-easy-test-series
programming
programming-in-c
pointers
+
–
2
votes
2
answers
462
MadeEasy Subject Test 2019: Programming & DS - Programming In C
main(){ int S[6] = {126,256,512,1024,2048,4096}; int *x=(int *) (&S+1); printf (“%d”,x); } int is 4 bytes; array starts from 2000 . The answer is 2024 I am getting 2004. Please explain the concept. If possible provide a resource.
main(){ int S[6] = {126,256,512,1024,2048,4096}; int *x=(int *) (&S+1); printf (“%d”,x); }int is 4 bytes; array starts from 2000 .The answer is 2024 I am getting 2004...
Shamim Ahmed
791
views
Shamim Ahmed
asked
Dec 11, 2018
Programming in C
made-easy-test-series
programming
programming-in-c
array
+
–
1
votes
2
answers
463
Gateforum Test Series: Programming & DS - Programming In C
What is the output of the following program? $main()$ { $char *s[]=\left \{ “ice”, “green”, “cone”, “please”\right \};$ $char **ptr[]=\left \{ s+3, s+2, s+1, s\right \};$ $char ***P=ptr;$ $printf(“\%s”,**++P);$ } Ice Green Cone Please I think the answer should be $B$ but $C$ is provided as answer.
What is the output of the following program?$main()${$char *s[]=\left \{ “ice”, “green”, “cone”, “please”\right \};$$char ptr[]=\left \{ s+3, s+2, s+1, s...
Gupta731
620
views
Gupta731
asked
Dec 9, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
0
votes
1
answer
464
MadeEasy Subject Test: Programming & DS - Programming in C
Vaishnavi01
999
views
Vaishnavi01
asked
Dec 7, 2018
Programming in C
made-easy-test-series
programming-in-c
programming
+
–
0
votes
0
answers
465
Testbook Test Series: Programming & DS - Programming In C
Deepesh Pai
279
views
Deepesh Pai
asked
Nov 29, 2018
Compiler Design
testbook-test-series
programming
programming-in-c
+
–
0
votes
1
answer
466
Gateforum Test Series: Programming & DS - Programming In C
Which of the statements are false about keyword register'? Register keyword can be used with a pointer variable as register can have address of memory location. We can use '&' operator with register variable and access address of ... of the above D) both b and c. Can someone explain the choice a more clearly in the above question?
Which of the statements are false about keyword ‘register’?Register keyword can be used with a pointer variable as register can have address of memory location.We can...
Parth Shah
461
views
Parth Shah
asked
Nov 29, 2018
Programming in C
gateforum-test-series
programming-in-c
programming
+
–
0
votes
0
answers
467
MadeEasy Test Series 2018: Programming & DS - Hashing
What is the number of collisions while doing insert operation on the hash table? Options are 3 4 5 6 Answer is 4 Can anyone tell me how?
What is the number of collisions while doing insert operation on the hash table? Options are 3456Answer is 4Can anyone tell me how?
Jyoti Kumari97
599
views
Jyoti Kumari97
asked
Nov 25, 2018
DS
programming
data-structures
hashing
made-easy-booklet
+
–
0
votes
0
answers
468
MadeEasy Test Series: Programming & DS - Programming In C
jatin khachane 1
532
views
jatin khachane 1
asked
Nov 23, 2018
Programming in C
made-easy-test-series
programming
pointers
+
–
0
votes
0
answers
469
self doubt
is it correct solution if it is correct please explain it.
is it correct solution if it is correct please explain it.
iamdeepakji
365
views
iamdeepakji
asked
Nov 21, 2018
Programming in C
programming
+
–
0
votes
1
answer
470
MadeEasy Workbook: Programming & DS - Programming In C
Options are 73 396 109 360 Answer given in book is 109. Can anyone tell me how ?
Options are73396109360 Answer given in book is 109.Can anyone tell me how ?
Jyoti Kumari97
1.0k
views
Jyoti Kumari97
asked
Nov 21, 2018
Programming in C
programming
programming-in-c
made-easy-booklet
+
–
0
votes
1
answer
471
Gateforum Test Series: Programming & DS - Programming In C
What will be the output of the following program [Addresses of the variables are assigned continuous] #include<stdio.h> void main() { int a = 4, b = 8, c = 12, d, e, f ; int *x=&a , *y=&b, *z =&c ; d =x - y ; e =y - z ; f = d - e ; printf("%d" ; f) ; } (A)Compiler error (B) -8; (C)8; (D) 2;
What will be the output of the following program[Addresses of the variables are assigned continuous]#include<stdio.h>void main(){int a = 4, b = 8, c = 12, d, e, f ;int *x...
Mahbub Alam
549
views
Mahbub Alam
asked
Nov 19, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
0
votes
1
answer
472
Gateforum Test Series: Programming & DS - Programming In C
#include<stdio.h> void main() { int i ; for(i=0; i<5; i++) f() ; } void f() { static int x ; x=5 ; x++ ; printf("%d", x); } OUTPUT OF THE FUNCTION IS (A)6,6,6,6,6 (B)6,7,8,9,10 (C)5,5,5,5,5 (D)5,6,7,8,9
#include<stdio.h>void main(){ int i ;for(i=0; i<5; i++)f() ;}void f(){static int x ;x=5 ;x++ ;printf("%d", x);}OUTPUT OF THE FUNCTION IS(A)6,6,6,6,6(B)6,7,8,9,10(C)5,5,5,...
Mahbub Alam
258
views
Mahbub Alam
asked
Nov 19, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
1
votes
1
answer
473
Gateforum Test Series: Programming & DS - Programming In C
Shivam Kasat
741
views
Shivam Kasat
asked
Nov 17, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
2
votes
1
answer
474
Gateforum Test Series: Programming & DS - Programming In C
Shivam Kasat
665
views
Shivam Kasat
asked
Nov 17, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
0
votes
1
answer
475
Gateforum Test Series: Programming & DS - Programming In C
Shivam Kasat
843
views
Shivam Kasat
asked
Nov 17, 2018
Programming in C
gateforum-test-series
programming-in-c
programming
+
–
0
votes
0
answers
476
programming
#include<stdio.h> int(*foo())[3] { static int a[3]={1,2,3}; printf("%d",*a); return &a; } int main() { static int (*p)[3]; p=foo(); printf("%d",*(*p+2)); return 0; } i try to make picture representation i think this is wrong please make correct
#include<stdio.h int(*foo())[3] { static int a[3]={1,2,3}; printf("%d",*a); return &a; } int main() { static int (*p)[3]; p=foo(); printf("%d",*(*p+2)); r...
Gurdeep Saini
419
views
Gurdeep Saini
asked
Nov 16, 2018
Programming in C
programming-in-c
programming
+
–
1
votes
0
answers
477
ACE BOOK , c-programming
what is the result of comparing signed with unsigned number?? #include <stdio.h> int main() { unsigned int a = 5; if(a > -1) printf("5 is > -1\n"); return 0; }
what is the result of comparing signed with unsigned number??#include <stdio.h>int main(){ unsigned int a = 5;if(a -1)printf("5 is -1\n"); return 0; }
Mahbub Alam
592
views
Mahbub Alam
asked
Nov 15, 2018
Programming in C
programming-in-c
output
programming
+
–
0
votes
1
answer
478
C programming
#include<stdio.h> void fun(int *p,int *q) { p=q; *p=q; } int i=0,j=1; int main() { fun(&i,&j); printf("%d%d",i,j); } What will be the output of i and j in 16-bit C Compiler?
#include<stdio.h void fun(int *p,int *q) { p=q; *p=q; } int i=0,j=1; int main() { fun(&i,&j); printf("%d%d",i,j); }What will be the output of i and j in 16-bit C Compiler...
Mr khan 3
1.0k
views
Mr khan 3
asked
Nov 3, 2018
Programming in C
programming-in-c
output
programming
pointers
+
–
0
votes
0
answers
479
Advance test algorithms
i am getting 36 please confirm given answer is 15
i am getting 36 please confirm given answer is 15
Prince Sindhiya
259
views
Prince Sindhiya
asked
Oct 23, 2018
Programming in C
data-structures
and
programming
+
–
0
votes
0
answers
480
arrays
Let arr[] be an array containing n integers. The following algorithm computes the frequency of each element in arr and stores it in another array fre[]. for(i=0;i<n;i++) { count=1; for(j=i+1;j<n;j++) { if(c) { count++; fre[j]=0; } } if(fre[i]!=0) { fre[i]=count; } } Choose the correct expression for C $A) arr[i]<=arr[j]$ $B) arr[i]>=arr[j]$ $C) arr[i]!=arr[j]$ $D) arr[i]==arr[j]$
Let arr[] be an array containing n integers. The following algorithm computes the frequency of each element in arr and stores it in another array fre[].for(i=0;i<n;i++) {...
Lakshman Bhaiya
453
views
Lakshman Bhaiya
asked
Oct 22, 2018
Programming in C
programming
array
+
–
Page:
« prev
1
...
11
12
13
14
15
16
17
18
19
20
21
...
32
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register