[algogeeks] Computer Organisation Q

2011-12-05 Thread Vijay Khandar
Which one of the following is true for a CPU having a single interrupt request line and a single interrupt grant line? a)Neither vectored interrupt nor multiple interrupting devices are possible. b)Vectored interrupts are not possible but multiple multiple interrupting devices are possible.

Re: [algogeeks] Link list Q

2011-12-02 Thread Vijay Khandar
complete 2 round of this single link before node p reaches last_node . so when p reaches last_node , at that point of time q would have reached last_node (hence completing this 2 circle). hope this will help you in understanding the idea. On Fri, Dec 2, 2011 at 12:14 PM, Vijay Khandar vijaykhand

[algogeeks] Link list Q

2011-12-01 Thread Vijay Khandar
What does the following program do on the singly linked list? p=head; q=head-next; while(p!=null q!null) { if(p==q) { exit(0) } p=p-next; q=(q-next)?(q-next-next):q-next; } a)traverse the entire singly linked list b)detects the duplicate nodes c)detects the loop in singly linked list d)detects

Re: [algogeeks] Link list Q

2011-12-01 Thread Vijay Khandar
But how plz explain in detail.. On Thu, Dec 1, 2011 at 8:14 PM, Karthikeyan V.B kartmu...@gmail.com wrote: detects the loop in the linked list -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] Data Structure Q

2011-11-30 Thread Vijay Khandar
A stack is implemented with two queues then what are the minimum enqueue and dequeue operations needed to perform for pop operation,where '10' elements are already in the first queue? please anyone provide soln with explation. -- You received this message because you are subscribed to

Re: [algogeeks] Data Structure Q

2011-11-30 Thread Vijay Khandar
, Vijay Khandar vijaykhand...@gmail.comwrote: A stack is implemented with two queues then what are the minimum enqueue and dequeue operations needed to perform for pop operation,where '10' elements are already in the first queue? please anyone provide soln with explation. -- You

[algogeeks] Networking Question

2011-11-18 Thread Vijay Khandar
How many bytes of data can be sent in 15 seconds over a serial link with baud rate of 9600 inasynchronous mode with odd parity and two stop bits in the frame? a)10,000 bytes b)12,000 bytes c) 15,000 bytes d)27,000 bytes Plz anyone explain me. Vijay.. -- You received this message

[algogeeks] Re: COA Question

2011-11-18 Thread Vijay Khandar
as     LOAD b     MUL a     STORE b Where each instance of a formal parameter has been replaced by its actual parameter. Dave On Nov 17, 5:32 am, Vijay Khandar vijaykhand...@gmail.com wrote: What are x and y in the following macro definition? macro  ADD x,y            LOAD y

[algogeeks] Re: Computer Organisation Q

2011-11-18 Thread Vijay Khandar
but why? On Nov 18, 9:14 am, ((** VICKY **)) venkat.jun...@gmail.com wrote: False not necessarily. On Nov 17, 4:03 pm, Vijay Khandar vijaykhand...@gmail.com wrote: Can anyone explain following sentence- True or False and explain All instructions affect the flags Vijay Khandar

[algogeeks] COA Question

2011-11-18 Thread Vijay Khandar
Relative mode of addressing is most relevant to writing a)coroutines b)position-independent code c)shareble code d)interrupt handlers plz anyone give me answer with explation... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] DS Q

2011-11-17 Thread Vijay Khandar
Thank u very much On Thu, Nov 17, 2011 at 4:05 PM, Piyush piyushmadan2...@gmail.com wrote: b) Binary search Binary search has to be done in O(logn) but in a linked list individual elements can't be accessed in O(1) time. and hence its not suitable to have a linked list as a

[algogeeks] Programming Question

2011-11-17 Thread Vijay Khandar
In the following Pascal Program segment what is the value of X after the execution of the program segment? X:=10; Y:=20; If XY,then if X0 then X:=abs(X) else X:=2*X; Plz anyone explain -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Re: Algm

2011-11-15 Thread Vijay Khandar
How it is Radix sort, why not Heapsort, plz explain me in detail.. On Nov 14, 3:36 pm, Ankur Garg ankurga...@gmail.com wrote: Radix Sort On Mon, Nov 14, 2011 at 1:57 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Which is the sorting algm sorts the integers  [1...n^3

[algogeeks] Algm

2011-11-14 Thread Vijay Khandar
Which is the sorting algm sorts the integers [1...n^3] in O(n). a)Heapsort b)Quicksort c)Mergesort d)Radix sort please tell anyone. Vijay. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

[algogeeks] B-tree

2011-09-10 Thread Vijay Khandar
Plz anyone write program in C++ and C of searching,inserting and deleting node in or from a B-tree... Vijay.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To

[algogeeks] Probability Q(Mean nd Variance)

2011-08-29 Thread Vijay Khandar
Let X and Y be jointly distributed random variables such that the conditional distribution of Y, given X=x, is uniform on the interval (x-1,x+1). Suppose E(X)=1 and Var(X)=5/3. Q.1 The mean of the random variable Y is First question using common data: (A) 1/2(B) 1(C)

Re: [algogeeks] confusion

2011-08-29 Thread Vijay Khandar
Array of pointers is= *a=A[10]; Pointers to array means= *A[10]; is this correct? On Mon, Aug 29, 2011 at 1:14 PM, Nitin coolguyinat...@gmail.com wrote: Please specify the difference between Array of pointer and Pointer to array???it's getting very messy -- You received this message

[algogeeks] DBMS Q

2011-08-26 Thread Vijay Khandar
ER-diagram is given and asking for min and max table. Can anyone Explain me .. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email

Re: [algogeeks] Post-Increment simple program - Aptitude probelm

2011-08-26 Thread Vijay Khandar
O\P-Bye I think so.plz explain how its hello On Fri, Aug 26, 2011 at 12:12 PM, Suraj Fale surajfa...@gmail.com wrote: Hey guys.. I know in this group all geeky stuffs goes on... but following lines of code i foind it intresting and thah y wants ot sahre it with you all. Its very

Re: [algogeeks] What is the output and how ???

2011-08-26 Thread Vijay Khandar
O\P= 1 2 1 3 1 2 1 is it correct? On Fri, Aug 26, 2011 at 12:23 PM, SAMMM somnath.nit...@gmail.com wrote: includestdio.h void fun(int); typedef int (*pf) (int, int); int proc(pf, int, int); int main() { int a=3; fun(a); return 0; } void fun(int n) { if(n 0) {

Re: [algogeeks] C-question

2011-08-23 Thread Vijay Khandar
Thank,,,Now got it. On Tue, Aug 23, 2011 at 11:22 AM, nagarajan naga4...@gmail.com wrote: Hi Vijay, i = 10 10 5 = 0 5 = 1 On Tue, Aug 23, 2011 at 11:03 AM, Vijay Khandar vijaykhand...@gmail.comwrote: main() { int x=10,y=10,z=5; int i=xyz; pf(\n%d,i); } o/p is 1 .pls

Re: [algogeeks] Re: C-question

2011-08-23 Thread Vijay Khandar
) which evaluates to 1 and that is what is assigned to i. On Aug 23, 10:33 am, Vijay Khandar vijaykhand...@gmail.com wrote: main() { int x=10,y=10,z=5; int i=xyz; pf(\n%d,i); } o/p is 1 .pls any1 explain me hw is it printing? -- You received this message because you

[algogeeks] C-question

2011-08-22 Thread Vijay Khandar
main() { int x=10,y=10,z=5; int i=xyz; pf(\n%d,i); } o/p is 1 .pls any1 explain me hw is it printing? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
rahultiwari6...@gmail.comwrote: @vijay u take normalised form of 5.375 wrong . actual normalised form of 5.375 = 0100 1010 1100 On Sun, Aug 21, 2011 at 10:12 AM, Vijay Khandar vijaykhand...@gmail.comwrote: but why only o/p-00 00 AC 40 and not AC 40 00 00

Re: [algogeeks] why the output 16

2011-08-21 Thread Vijay Khandar
FUNC1(i) (i*(i-1))=so put i-1 as it is on i=so (i-1*(i-1-1)) and i=8 so(8-1*(8-1-1))=(8-1(6))=2 and mul bu 8=16 On Sun, Aug 21, 2011 at 4:03 PM, Prakash D cegprak...@gmail.com wrote: FUNC2(8) == 8==0? 1: 8 * FUNC1(8-1) == 8==0? 1: 8*( 8-1* 8-1-1) == 8 * (8-8-2) == -16 but why 16??

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
Thank u very much Abhishek for this link, Now I got it ...But also u explain me in following.. 5.375 is represents 0100 1010 1100 means 4 0 A C 0 0 0 0in Hex now how it prints 00 00 AC 40 means can it accepts fm right to left or L to R I m little

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
, Puneet Chawla puneetchawla...@gmail.comwrote: Compiler is little endian so as u have typecasted it to char pointer then 0100 1010 1100 means 4 0 A C 0 0 0 0 it will show o/p byte by byte from LSB. On Sun, Aug 21, 2011 at 5:47 PM, Vijay Khandar vijaykhand

Re: [algogeeks] C-Question

2011-08-21 Thread Vijay Khandar
as u have typecasted it to char pointer then 0100 1010 1100 means 4 0 A C 0 0 0 0 it will show o/p byte by byte from LSB. On Sun, Aug 21, 2011 at 5:47 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Thank u very much Abhishek for this link, Now I got

Re: [algogeeks] Microsoft :)

2011-08-21 Thread Vijay Khandar
Congrates Harshal!! On Sat, Aug 6, 2011 at 12:15 PM, Harshal hc4...@gmail.com wrote: Algogeeks is really awesome and very informative. I got a job in microsoft, and this group has played vital role in building concepts. So I just want to thank this group and the people here.. keep it

[algogeeks] GK-Q

2011-08-20 Thread Vijay Khandar
main() { printf(\n %x,-14); } o/p- Plz tell me anyone how this program is working? what is the meaning of -14, 456,-665 etc.. how this statement is executed..? Vijay -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] thanx...

2011-08-20 Thread Vijay Khandar
Congrates On Sat, Aug 20, 2011 at 10:20 AM, Ankur pratik ankurocks...@gmail.comwrote: samsung engineering labs On Sat, Aug 20, 2011 at 10:18 AM, sukran dhawan sukrandha...@gmail.comwrote: where ? On Sat, Aug 20, 2011 at 10:16 AM, ankur pratik ankurocks...@gmail.comwrote: thanx to

Re: [algogeeks] GK-Q

2011-08-20 Thread Vijay Khandar
-14 left shifting 4 bits %x prints in hexa decimal format so o/p- f f f 0 On Sat, Aug 20, 2011 at 11:39 AM, Vijay Khandar vijaykhand...@gmail.comwrote: main() { printf(\n %x,-14); } o/p- Plz tell me anyone how this program is working? what

Re: [algogeeks] GK-Q

2011-08-20 Thread Vijay Khandar
On Sat, Aug 20, 2011 at 11:55 AM, Vijay Khandar vijaykhand...@gmail.comwrote: Thank you very much..now i got it. On Sat, Aug 20, 2011 at 11:51 AM, Ayswarya Srinivasan krsayswa...@gmail.com wrote: i guess the output is fff0 -1 = 0001 taking 1's

Re: [algogeeks] C-Question

2011-08-20 Thread Vijay Khandar
but why only o/p-00 00 AC 40 and not AC 40 00 00 or 00 AC 40 00 or 40 AC 00 00etc , plz explain in detail how p[0] pts to 00 and p[1] pts to 00 and p[2] pts AC or 1010 1100 and p[3] pts to 40 or 0100 ONLY in this way..Vijay Khandar... On Sat, Aug 20, 2011 at 12:31 PM

Re: [algogeeks] GK-Q

2011-08-20 Thread Vijay Khandar
Thanks to all.. On Sun, Aug 21, 2011 at 12:07 AM, Sanjay Rajpal srn...@gmail.com wrote: it will be like . I have mentioned that leftmost 1 bit will be carried with shift. Sanju :) On Sat, Aug 20, 2011 at 11:18 AM, Abhishek

[algogeeks] C-Question

2011-08-19 Thread Vijay Khandar
If the binary equivalent of 5.375 in normalised form is - 0100 1010 1100 what is the o/p of following code- main() { float a=5.375; char *p; int i; p=(char *)a; for(i=0;i=3;i++) printf(%02X,(unsigned char)p[i]); } O/P= 00 00 AC 40 Plz, Plz anyone explain me in detail,

[algogeeks] Structure Q

2011-08-05 Thread Vijay Khandar
struct list { int x; struct list *next; }*head; The statement head.x=100 A)assigns 100 to one element of the structure list B)creates a node of type list and assigns a value to x C)creates a head of the list D)error Plz anyone provide correct option with explanation.. -- You

Re: [algogeeks] Structure Q

2011-08-05 Thread Vijay Khandar
Thanks On Fri, Aug 5, 2011 at 5:25 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote: ERROR On Fri, Aug 5, 2011 at 5:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote: struct list { int x; struct list *next; }*head; The statement head.x=100 A)assigns 100 to one element

Re: [algogeeks] Structure Q

2011-08-05 Thread Vijay Khandar
Thanks. On Fri, Aug 5, 2011 at 5:26 PM, ankit sambyal ankitsamb...@gmail.comwrote: error because head is a pointer to the structure, hence head.x gives an error -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

[algogeeks] Question

2011-08-05 Thread Vijay Khandar
What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0;i=3;i++) scanf(%s %f,e[i].name,e[i].sal); getch(); } Plz Explain

[algogeeks] Question

2011-08-05 Thread Vijay Khandar
What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0;i=3;i++) scanf(%s %f,e[i].name,e[i].sal); getch(); } A)floating point format

Re: [algogeeks] Question

2011-08-05 Thread Vijay Khandar
But program is not working properly... On Fri, Aug 5, 2011 at 5:44 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: Couldn't find any error. On Fri, Aug 5, 2011 at 5:38 PM, Vijay Khandar vijaykhand...@gmail.comwrote: What errors are you likely to get when you run the following

Re: [algogeeks] Question

2011-08-05 Thread Vijay Khandar
are to make it compatible to gcc compiler. Check the statement in the bottom of the page. On Fri, Aug 5, 2011 at 5:46 PM, Vijay Khandar vijaykhand...@gmail.comwrote: What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main

Re: [algogeeks] Question

2011-08-05 Thread Vijay Khandar
emulator to be linked */ a = *b ;/* suppress the warning - variable not used */ }; On Fri, Aug 5, 2011 at 6:04 PM, Vijay Khandar vijaykhand...@gmail.comwrote: But program is not giving the o/p. I have taken one printf statement same as scanf..and scanf() taking i/p but prinf() not giving o

Re: [algogeeks] simple doubt

2011-08-05 Thread Vijay Khandar
I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int

Re: [algogeeks] Question

2011-08-05 Thread Vijay Khandar
); } There is always some problem in string input using %s, don't really know why though deeply. On 5 August 2011 17:48, Vijay Khandar vijaykhand...@gmail.com wrote: But program is not working properly... On Fri, Aug 5, 2011 at 5:44 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: Couldn't find

Re: [algogeeks] Question

2011-08-05 Thread Vijay Khandar
) { float a=0,*b=a; a=*b; } this code forces the emulator to be linked On Fri, Aug 5, 2011 at 7:38 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Yes correct, In m using very old compiler Turbo C++ On Fri, Aug 5, 2011 at 7:34 PM, Rohit Srivastava access2ro...@gmail.comwrote: you

Re: [algogeeks] simple doubt

2011-08-05 Thread Vijay Khandar
element and so arr contain address of that pointer ? On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.com

[algogeeks] PTR Q

2011-08-05 Thread Vijay Khandar
Pointers provide a convenient way to represent multidimensional arrays, allowing a single array multidimensional array to be replaced by a lower-dimensional array of pointers. this statement is true or false... Plz Explain -- You received this message because you are subscribed to the

Re: [algogeeks] Normal Form

2011-08-04 Thread Vijay Khandar
becoz , Consider two Attributes, A B then possibility are, 1)AB is a key then directly in BCNF, 2)A is a key then automaticaly B is depend on A 3)vice versa of 2) so A relation with two attributes is always 2Nf,3nf and also in BCNF form. Vijay On Thu, Aug 4, 2011 at 2:51 PM,

[algogeeks] pointer question

2011-08-04 Thread Vijay Khandar
#includestdio.h #includeconio.h void main() { clrscr(); float a=5.375; char *p; int i; p=(char *)a; for(i=0;i=3;i++) printf(%02x,(unsigned char)p[i]); getch(); } O/P-00 00 AC 40 Plz anyone explain me output. Vijay -- You received this message because you are subscribed to the

Re: [algogeeks] Re: pointer question

2011-08-04 Thread Vijay Khandar
Thanks, but can u elaborate some more explanation, that how for loop is working here Vijay On Thu, Aug 4, 2011 at 9:52 PM, wastrel virmanisadi...@gmail.com wrote: floating point numbers are stored in 4 bytes with first 3 bytes storing the mantissa part...1st bit of last byte

[algogeeks] C-Question

2011-08-02 Thread Vijay Khandar
for(i=1,j=10;i6;++i,--j) pf(%d %d,i,j); and for(i=1,j=10;i6;i++,j--) pf(%d %d,i,j); why this both giving same o/p, since one is pre and other is postplz explain me -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

Re: [algogeeks] C-Question

2011-08-02 Thread Vijay Khandar
. As in for loop three sequential steps are . 1. Initialization 2. Checking condition 3. Increment or decrement On Tue, Aug 2, 2011 at 2:56 PM, Vijay Khandar vijaykhand...@gmail.com wrote: for(i=1,j=10;i6;++i,--j) pf(%d %d,i,j); and for(i=1,j=10;i6;i++,j--) pf(%d %d,i,j); why

Re: [algogeeks] C-Question

2011-08-02 Thread Vijay Khandar
Thanks Jagrati On Tue, Aug 2, 2011 at 3:19 PM, jagrati verma jagrativermamn...@gmail.comwrote: coz we do in for loop 1st initialization thn condition thn increment so in 1st for loop it will print the value thn increment the i's value so itll behave like a i++ dats y no

[algogeeks] string easy question

2011-08-02 Thread Vijay Khandar
#includestdio.h #includeconio.h #includestring.h void main() { clrscr(); char str1[]=Hello; char str2[]=Hello; int i; if(strcmp(str1,str2)) printf (\n Equal); else printf(\n Unequal); getch(); } Plz anyone explain me o/p with explanation. Vijay -- You received this

Re: [algogeeks] string easy question

2011-08-02 Thread Vijay Khandar
, 2011 at 7:47 PM, Vijay Khandar vijaykhand...@gmail.comwrote: #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); char str1[]=Hello; char str2[]=Hello; int i; if(strcmp(str1,str2)) printf (\n Equal); else printf(\n Unequal); getch(); } Plz anyone explain me o/p

[algogeeks] C-Question

2011-08-01 Thread Vijay Khandar
main() { int a=6,b=10,x; x=ab; printf(%d,x); } O/P=2 Plz any one explain me ,how its come -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send

Re: [algogeeks] Logical operator question

2011-07-29 Thread Vijay Khandar
Thanks, but also one small doubt If x=y=z=-4 then plz tell me o/p of pf(++x++y||++z) and pf(x,y,z) these two statements. On Fri, Jul 29, 2011 at 10:52 AM, jagrati verma jagrativermamn...@gmail.com wrote: vijay x=y=z=-1 so for ++x++y||++z ++x=0 so 1st condition will get false so

Re: [algogeeks] Logical operator question

2011-07-29 Thread Vijay Khandar
Yes , so can u explai me plz, i m little bit confusing..Vijay On Fri, Jul 29, 2011 at 12:39 PM, Prem Krishna Chettri hprem...@gmail.comwrote: 1 and -3 -3 -4.. Verify the Compilation.. Regards Prem On Fri, Jul 29, 2011 at 12:35 PM, Vijay Khandar vijaykhand

Re: [algogeeks] Logical operator question

2011-07-29 Thread Vijay Khandar
Thanks Prem got it now... On Fri, Jul 29, 2011 at 12:44 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Yes , so can u explai me plz, i m little bit confusing..Vijay On Fri, Jul 29, 2011 at 12:39 PM, Prem Krishna Chettri hprem...@gmail.com wrote: 1 and -3 -3

Re: [algogeeks] Logical operator question

2011-07-29 Thread Vijay Khandar
, Jul 29, 2011 at 12:44 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Yes , so can u explai me plz, i m little bit confusing..Vijay On Fri, Jul 29, 2011 at 12:39 PM, Prem Krishna Chettri hprem...@gmail.com wrote: 1 and -3 -3 -4.. Verify the Compilation

Re: [algogeeks] C-question

2011-07-28 Thread Vijay Khandar
01 Hope you get the recursion there . On Wed, Jul 27, 2011 at 11:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote: #includestdio.h #includeconio.h int f(int n) { if(n=1) { printf( %d,n); } else { f(n/2); printf( %d,n%2); } } void main() { clrscr(); f(173); getch

Re: [algogeeks] Logical operator question

2011-07-28 Thread Vijay Khandar
sagarpar...@gmail.comwrote: +1 @ankur :) On Wed, Jul 27, 2011 at 11:23 PM, Ankur Khurana ankur.kkhur...@gmail.com wrote: one request : dont use trubo C On Wed, Jul 27, 2011 at 10:23 PM, Vijay Khandar vijaykhand...@gmail.com wrote: I m getting o/p 1 2 1 1 1 2 2 1 but on wards when x

Re: [algogeeks] Logical operator question

2011-07-28 Thread Vijay Khandar
0 0-1-1 Thx.. On Thu, Jul 28, 2011 at 11:47 AM, sagar pareek sagarpar...@gmail.comwrote: +1 @ankur :) On Wed, Jul 27, 2011 at 11:23 PM, Ankur Khurana ankur.kkhur...@gmail.com wrote: one request : dont use trubo C On Wed, Jul 27, 2011 at 10:23 PM, Vijay Khandar vijaykhand

[algogeeks] Question

2011-07-27 Thread Vijay Khandar
#includestdio.h #includeconio.h void main() { clrscr(); int x=1,y=1,z=1; x+=y+=z; printf(\n %d\n ,xy?y:x); printf(\n %d\n,xy?x++:y++); printf(\n %d %d\n,x,y); printf(\n %d\n,z+=xy?x++:y++); printf(\n %d %d %d\n,x,y,z); x=3;y=z=4; printf(\n %d\n,z=y=x?1:0); printf(\n %d\n,z=yy=x); getch(); } I m

[algogeeks] Logical operator question

2011-07-27 Thread Vijay Khandar
#includestdio.h #includeconio.h void main() { clrscr(); int x,y,z; x=y=z=1; printf(\n %d,++x||++y++z); printf(\n %d %d %d ,x,y,z); x=y=z=1; printf(\n %d,++x++y||++z); printf(\n %d %d %d,x,y,z); x=y=z=1; printf(\n %d,++x++y++z); printf(\n %d %d %d,x,y,z); x=y=z=-1; printf(\n %d,++x++y||++z);

Re: [algogeeks] Logical operator question

2011-07-27 Thread Vijay Khandar
I m getting o/p 1 2 1 1 1 2 2 1 but on wards when x=y=z= -1 then i m getting something different o/p. On Wed, Jul 27, 2011 at 10:18 PM, Jnana Sagar supremeofki...@gmail.comwrote: what do u mean by o/p..actually what r u asking for..sorry to ask so..i couldn't get u.. On 7/27/11, Vijay

[algogeeks] C-question

2011-07-27 Thread Vijay Khandar
#includestdio.h #includeconio.h int f(int n) { if(n=1) { printf( %d,n); } else { f(n/2); printf( %d,n%2); } } void main() { clrscr(); f(173); getch(); } o/p-1 0 1 0 1 1 0 1 but i m getting 1 0 1 1 0 1 0 1 plz explain me... -- You received this message because you are subscribed to

[algogeeks] GATE C-Question

2011-07-26 Thread Vijay Khandar
Consider the following C-function in which a[n] and b[m] are two sorted integer arrays and c[n+m] be an other integer array. void XYZ(int a[],int b[], int c[]) { int i,j,k; i=j=k=0; while((in)(jm)) { if (a[i]b[j]) c[k++]=a[i++]; else c[k++]=b[j++]; } Which of the following condition(s)

[algogeeks] GATE C-Question

2011-07-26 Thread Vijay Khandar
Consider the following C-function in which a[n] and b[m] are two sorted integer arrays and c[n+m] be an other integer array. void XYZ(int a[],int b[], int c[]) { int i,j,k; i=j=k=0; while((in)(jm)) { if (a[i]b[j]) c[k++]=a[i++]; else c[k++]=b[j++]; } Which of the following condition(s)

[algogeeks] Competetive C-Question

2011-07-26 Thread Vijay Khandar
Consider these two functions and two statements S1 and S2 about them. int work1(int *a,int i,int j) { int x=a[i+2]; a[j]=x+1; return a[i+2]-3; } int work2(int *a,int i,int j) { int t1=i+2; int t2=a[t1]; a[j]=t2+1; return t2-3; } S1)The transformation from work1 to work2 is valid, i.e.,for any

Re: [algogeeks] Competetive C-Question

2011-07-26 Thread Vijay Khandar
Thanks Ankit.. On Tue, Jul 26, 2011 at 9:26 PM, ankit sambyal ankitsamb...@gmail.comwrote: D) S1 and S2 both are true S2 is true because return a[i+2]-3; takes more time than return t2-3; -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] C Output

2011-07-25 Thread Vijay Khandar
ptr points to base addr of a.And on base adrr of a is 1.Assume base addr of a is 4000 then 1-4000,2-4002,3-4004,4-4006 and 5 on 4008 so op 1if in question asking *(ptr+2) then op is 3. Vijay.. On Mon, Jul 25, 2011 at 8:20 PM, swetha rahul swetharahu...@gmail.comwrote: int main() {

Re: [algogeeks] preprocessor directives

2011-07-25 Thread Vijay Khandar
O/P=9 and 49 since i++ * i++ and++ is postincrement so 3*3=9 then both i++ * i++ goes to 4and 5 now i=5. then for ++i*++i and ++ is preincrement so first it will 6 and 7 and then 7*7=49 Vijay.. On Mon, Jul 25, 2011 at 8:22 PM, Arshad Alam alam3...@gmail.com wrote: what would be

[algogeeks] C question

2011-07-25 Thread Vijay Khandar
#includestdio.h #includeconio.h int f(int n,int k) { if (n==0) return 0; else if(n%2) return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } int main() { clrscr(); printf(\n %d,f(20,1)); getch(); } O/p is 9.Plz explai me how it is come Vijay. -- You received this message

Re: [algogeeks] C question

2011-07-25 Thread Vijay Khandar
16-8=8 0+16 - - *Muthuraj R. 4TH Year BE.** Information Science Dept* *PESIT, Bengaluru . * On Mon, Jul 25, 2011 at 8:48 AM, Vijay Khandar vijaykhand...@gmail.comwrote: #includestdio.h #includeconio.h int f(int n,int k) { if (n==0) return 0; else

Re: [algogeeks] C question

2011-07-25 Thread Vijay Khandar
f(2,8) will be agn else and return will be f(1,16)-8 now fr f(1,16) return will be f(0,32) +16 and now at last return will be 0 so the value will be -1-2+4-8+16=9 On Mon, Jul 25, 2011 at 9:18 PM, Vijay Khandar vijaykhand...@gmail.comwrote: #includestdio.h #includeconio.h int f(int n,int