[algogeeks] Re: What is the Output?? and How??
can u please explain this code or give the link to the thread u mentioned before??? On Sep 7, 10:35 pm, nagarajan naga4...@gmail.com wrote: please can u explain.. or copy the explained content??? On Wed, Sep 7, 2011 at 11:03 PM, sukran dhawan sukrandha...@gmail.comwrote: its already been explained in previous thread On Wed, Sep 7, 2011 at 11:01 PM, NAGARAJAN SIVARAMAN naga4...@gmail.comwrote: #includestdio.h #includeconio.h #define prn(a) printf(%d ,a) #define print(a,b,c) prn(a),prn(b),prn(c) #define max(a,b) (ab)?b:a void main() { int x=1,y=2; clrscr(); print(max(x++,y),x,y); printf(\n%d %d\n,x,y); print(max(x++,y),x,y); printf(\n%d %d\n,x,y); getch(); } -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nagarajan S -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: What is the Output?? and How??
http://groups.google.com/group/algogeeks/browse_frm/thread/274f63b24388599d/da635c4f409d5e1b?lnk=gstq=print%28max%28x%2B%2B%2Cy%29%2Cx%2Cy%29%3B+#da635c4f409d5e1b On Sep 8, 2:04 am, htross htb...@gmail.com wrote: can u please explain this code or give the link to the thread u mentioned before??? On Sep 7, 10:35 pm, nagarajan naga4...@gmail.com wrote: please can u explain.. or copy the explained content??? On Wed, Sep 7, 2011 at 11:03 PM, sukran dhawan sukrandha...@gmail.comwrote: its already been explained in previous thread On Wed, Sep 7, 2011 at 11:01 PM, NAGARAJAN SIVARAMAN naga4...@gmail.comwrote: #includestdio.h #includeconio.h #define prn(a) printf(%d ,a) #define print(a,b,c) prn(a),prn(b),prn(c) #define max(a,b) (ab)?b:a void main() { int x=1,y=2; clrscr(); print(max(x++,y),x,y); printf(\n%d %d\n,x,y); print(max(x++,y),x,y); printf(\n%d %d\n,x,y); getch(); } -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Nagarajan S -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: What is the output and how ???
The O/P is 0,1,2,0, But how -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: What is the output and how ???
o/p:- 0,1,2,0.. iIts simple stack concepts... during each recursive call it will goes on to store 2,1,0 and then *it will print 0* . call it agin with -1 then ... its false then* it will print 1* and again it will become 0... its false so it takes value from stack which is 2.. so *it will print 2*... and last value from stack i.,e 0 .. so *it will print 0.* On Fri, Aug 26, 2011 at 12:45 PM, SAMMM somnath.nit...@gmail.com wrote: The O/P is 0,1,2,0, But how -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Suraj Fale +91-9766103115 -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: What is the output and how ???
Here is a simpler way to understand. fun(0) = prints nothing fun(1) = f(0) + print 0 + fun(-1) = 0 fun(2) = fun(1) + print 1 + fun (0) = 0 1 fun(3) = fun(2) + print 2 + fun(1) = 0 1 2 0 Karthik R, RD Engineer, Tejas Networks. On Fri, Aug 26, 2011 at 1:02 PM, Suraj Fale surajfa...@gmail.com wrote: o/p:- 0,1,2,0.. iIts simple stack concepts... during each recursive call it will goes on to store 2,1,0 and then *it will print 0* . call it agin with -1 then ... its false then* it will print 1* and again it will become 0... its false so it takes value from stack which is 2.. so *it will print 2*... and last value from stack i.,e 0 .. so *it will print 0.* On Fri, Aug 26, 2011 at 12:45 PM, SAMMM somnath.nit...@gmail.com wrote: The O/P is 0,1,2,0, But how -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Suraj Fale +91-9766103115 -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: What is the output and how ???
yeah...just clear concept of recursion...its simple form test ur c skilss..(function.) On Aug 26, 1:22 pm, kARTHIK R k4rth...@gmail.com wrote: Here is a simpler way to understand. fun(0) = prints nothing fun(1) = f(0) + print 0 + fun(-1) = 0 fun(2) = fun(1) + print 1 + fun (0) = 0 1 fun(3) = fun(2) + print 2 + fun(1) = 0 1 2 0 Karthik R, RD Engineer, Tejas Networks. On Fri, Aug 26, 2011 at 1:02 PM, Suraj Fale surajfa...@gmail.com wrote: o/p:- 0,1,2,0.. iIts simple stack concepts... during each recursive call it will goes on to store 2,1,0 and then *it will print 0* . call it agin with -1 then ... its false then* it will print 1* and again it will become 0... its false so it takes value from stack which is 2.. so *it will print 2*... and last value from stack i.,e 0 .. so *it will print 0.* On Fri, Aug 26, 2011 at 12:45 PM, SAMMM somnath.nit...@gmail.com wrote: The O/P is 0,1,2,0, But how -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Suraj Fale +91-9766103115 -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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 to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.