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
Hot questions in Programming and DS
2
votes
4
answers
4111
UGC NET CSE | December 2012 | Part 2 | Question: 25
Suppose that someone starts with a chain letter. Each person who receives the letter is asked to send it on to $4$ other people. Some people do this, while some do not send any letter. How many people have seen the letter, including the first person, if none ... out the letter? $122$ & $22$ $111$ & $11$ $133$ & $33$ $144$ & $44$
Suppose that someone starts with a chain letter. Each person who receives the letter is asked to send it on to $4$ other people. Some people do this, while some do not se...
Shimpy Goyal
6.7k
views
Shimpy Goyal
asked
Jun 23, 2015
DS
ugcnetcse-dec2012-paper2
tree
+
–
1
votes
1
answer
4112
C Programming(interview)
Write an algorithm of the given problem Given a chess board of order NxM and source points (s1,s2) and destination points (d1,d2), Your task to find min number of moves required by the Knight to go to the destination cell.
Write an algorithm of the given problemGiven a chess board of order NxM and source points (s1,s2) and destination points (d1,d2), Your task to find min number of moves re...
srestha
1.2k
views
srestha
asked
Mar 23, 2017
Programming in C
programming-in-c
+
–
1
votes
1
answer
4113
#PROG
predict the correct options #include <stdio.h> int main() { if (sizeof(int) > -1) printf("Yes"); else printf("No"); return 0; } 1.yes 2.no 3.compiler error 3.garbage value
predict the correct options#include <stdio.h>int main(){ if (sizeof(int) -1) printf("Yes"); else printf("No"); return 0;}1.yes2.no3.compiler error...
Shashank Kumar Mishr
677
views
Shashank Kumar Mishr
asked
May 17, 2017
0
votes
1
answer
4114
c programming
program in c to reverse a number with all 0's and 1's or a binary no.?
program in c to reverse a number with all 0's and 1's or a binary no.?
AIkiran01
249
views
AIkiran01
asked
Jun 5, 2017
0
votes
0
answers
4115
increment-decrement
#include <stdio.h> void main() { int a = -5; int k = (a++, ++a); printf("%d\n", k); } how to solve this int k = (a++, ++a); expression?
#include <stdio.h>void main(){int a = -5;int k = (a++, ++a);printf("%d\n", k);}how to solve this int k = (a++, ++a); expression?
Aakash1125
903
views
Aakash1125
asked
Apr 23, 2017
0
votes
1
answer
4116
Modified form of gate - 2000 , ISRO 2015
#include<stdio.h> struct { short x[5]; union { float y; long z; }u; }t; int main() { printf("short=%d\n",sizeof(short)); printf("float=%d\n",sizeof(float)); printf("long=%d\n",sizeof(long)); printf("%d", ... } Answer should be 14 but why the answer is 16 ? Note : short : 2 bytes , float : 4 bytes , long : 4 bytes
#include<stdio.h struct { short x[5]; union { float y; long z; }u; }t; int main() { printf("short=%d\n",sizeof(short)); printf("float=%d\n",sizeof(float)); printf("long=%...
dragonball
452
views
dragonball
asked
Apr 26, 2017
2
votes
1
answer
4117
MADE EASY TEST SERIES
The maximum size of operator stack, when converting the following infix expression to postfix expression? Assume that has the highest precedence and follows right associativity is _______. Infix:
The maximum size of operator stack, when converting the following infix expression to postfix expression? Assume that has the highest precedence and follows right associ...
User007
2.1k
views
User007
asked
Feb 3, 2017
–1
votes
0
answers
4118
self made
if i = -5 then value of i++ is: -6/-4????
if i = -5 then value of i++ is: -6/-4????
Hira Thakur
236
views
Hira Thakur
asked
Jun 10, 2017
0
votes
2
answers
4119
Programming & DS - Binary Tree
Whats wrong with option B? Give an example?
Whats wrong with option B?Give an example?
Adiaspirant
674
views
Adiaspirant
asked
Jan 8, 2017
DS
data-structures
binary-tree
+
–
1
votes
1
answer
4120
Space complexity
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls. A)insertion sort B)quick sort C)merge sort D)selection sort
Which of the following algorithm have the smallest memory requirement i.e Low space complexity including data space and run time stack for recursive calls.A)insertion sor...
reena_kandari
1.7k
views
reena_kandari
asked
Feb 5, 2017
Programming in C
algorithms
space-complexity
sorting
+
–
1
votes
2
answers
4121
C programming doubt
I am getting segmentation fault for the following code.Please help to rectify. #include <stdio.h> #include <stdlib.h> struct person { int age; float weight; char *name; }; int main() { struct person *ptr; int i, num; printf("Enter number of persons: "); ... printf("%s\t%d\t%.2f\n", ptr->name[i], (ptr+i)->age, (ptr+i)->weight); return 0; }
I am getting segmentation fault for the following code.Please help to rectify. #include <stdio.h #include <stdlib.h struct person { int age; float weight; char *name; }; ...
Pranabesh Ghosh 1
1.2k
views
Pranabesh Ghosh 1
asked
Mar 23, 2017
0
votes
1
answer
4122
OUTPUT OF PROGRAM
Sanjay Sharma
292
views
Sanjay Sharma
asked
May 27, 2017
0
votes
2
answers
4123
Ds-tree
Given numbers from 1 to 8. Number 5 is the root of BST.How many number of BST are possible with given constraint.
Given numbers from 1 to 8. Number 5 is the root of BST.How many number of BST are possible with given constraint.
PreSha
301
views
PreSha
asked
May 25, 2017
0
votes
0
answers
4124
In the following program where is the variable a getting defined and where it is getting declared?
In the following program where is the variable a getting defined and where it is getting declared? #include int main() { extern int a; printf("%d\n", a); return 0; } int a=20; (a) extern int a ... definition (c) int a = 20 is definition, a is not defined (d) a is declared, a is not defined
In the following program where is the variable a getting defined and where it is getting declared?#includeint main(){ extern int a;printf("%d\n", a);return 0;} int a=20;(...
Akriti sood
2.5k
views
Akriti sood
asked
Jan 11, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
4125
Question regarding dangling pointer
#include <stdio.h> int*fun() { intx=5; return&x; } int main(){ int*p=fun(); fflush(stdin); printf("%d",*p); return0; } Please explain this code, how's it's working line by line. Thank you!
#include <stdio.h int*fun() { intx=5; return&x; } int main(){ int*p=fun(); fflush(stdin); printf("%d",*p); return0; }Please explain this code, how's it's working line by ...
iarnav
670
views
iarnav
asked
May 5, 2017
Programming in C
pointers
programming-in-c
+
–
0
votes
1
answer
4126
doubt
Arnabi
289
views
Arnabi
asked
Jan 13, 2017
DS
stack
+
–
0
votes
1
answer
4127
oo c++
What is this pointer? and what is the use of this pointer?
What is this pointer? and what is the use of this pointer?
iarnav
346
views
iarnav
asked
May 27, 2017
Programming in C
pointers
+
–
0
votes
2
answers
4128
strcpy() code question
strcpy() char* strcpy(char*s,char*t) { *s=malloc(strlen(source)+1); while((*s=*t)!='\o') { s++; t++; } return s; } Please someone tell, that line *s=malloc(strlen(source)+1); will return s;
strcpy() char* strcpy(char*s,char*t) { *s=malloc(strlen(source)+1); while((*s=*t)!='\o') { s++; t++; } return s; }Please someone tell, that line *s=malloc(strlen(source)+...
iarnav
566
views
iarnav
asked
May 6, 2017
Programming in C
programming-in-c
data-structures
+
–
11
votes
1
answer
4129
Recursion : Tower of hanoi
In the tower of Hanoi $x , y , z$ are the positions and we are to move 10 disks from $x$ to $y$. What are the $128$th and $768$th moves ? (A) $x\rightarrow y$ and $x\rightarrow z$ (B) $x\rightarrow z$ and $z\rightarrow x$ (C) $x\rightarrow z$ and $z\rightarrow y$ (D) $x\rightarrow y$ and $z\rightarrow y$
In the tower of Hanoi $x , y , z$ are the positions and we are to move 10 disks from $x$ to $y$. What are the $128$th and $768$th moves ?(A) $x\rightarrow y$ and $x\right...
dd
2.8k
views
dd
asked
Oct 31, 2016
DS
recursion
algorithms
+
–
0
votes
3
answers
4130
Algorithms
what is the maximum difference between height of two nodes of AVL tree a.1 b.2 c.3 d.none
what is the maximum difference between height of two nodes of AVL treea.1b.2c.3d.none
Vasu_gate2017
522
views
Vasu_gate2017
asked
May 14, 2017
DS
data-structures
avl-tree
+
–
Page:
« prev
1
...
201
202
203
204
205
206
207
208
209
210
211
...
309
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register