Re: [algogeeks] Re: Adding Two no without using any operator...??
@sharmila u r using + operator -- 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: Adding Two no without using any operator...??
if this is the case program can be rewritten to #Iincludestdio.h #includeconio.h void main() { int a,b,i; clrscr(); printf(enter 2 num:); scanf(%d%d,a,b); while(b--) a++; printf(%d,a); getch(); } Thank you, Sid. On Fri, Sep 2, 2011 at 11:30 AM, annarao kataru kataruanna...@gmail.comwrote: @sharmila u r using + operator -- 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.
Re: [algogeeks] Re: Adding Two no without using any operator...??
Adding Two no without using any operator #Iincludestdio.h #includeconio.h void main() { int a,b,i; clrscr(); printf(enter 2 num:); scanf(%d%d,a,b); for(i=1;i=b-1;i++) { a=a+1; } printf(%d,a); 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.
Re: [algogeeks] Re: Adding Two no without using any operator...??
@dave well that was basically a query if it is possible to eliminate all the operators and do something like addition operation.I am sorry if I presentted my question in the wrong wayI am bad at explaining things.:( Going by your previous records I am not elibigle to contradict you. On Mon, Aug 29, 2011 at 9:02 AM, Dave dave_and_da...@juno.com wrote: @Saurabh: Function calls and commas are operators, so that leaves out your clever printf solution. See http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Other_operators. Dave On Aug 28, 9:32 pm, saurabh singh saurab...@gmail.com wrote: @dave even '=' is an operator.I wonder if its possible to restrict *all operators*. On Sun, Aug 28, 2011 at 1:32 AM, Dave dave_and_da...@juno.com wrote: @Brijesh: Maybe you mean char *p; p = (char*)a; sum = (int)p[b]; // sum = a + b but is an operator. Dave On Aug 27, 2:07 pm, Brijesh brijeshupadhyay...@gmail.com wrote: How to add two nos without using any operator...? -- 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. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD- Hide quoted text - - Show quoted text - -- 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. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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: Adding Two no without using any operator...??
Awesome Saurabh. Hats off man:) On Mon, Aug 29, 2011 at 2:43 PM, saurabh singh saurab...@gmail.com wrote: @dave well that was basically a query if it is possible to eliminate all the operators and do something like addition operation.I am sorry if I presentted my question in the wrong wayI am bad at explaining things.:( Going by your previous records I am not elibigle to contradict you. On Mon, Aug 29, 2011 at 9:02 AM, Dave dave_and_da...@juno.com wrote: @Saurabh: Function calls and commas are operators, so that leaves out your clever printf solution. See http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Other_operators. Dave On Aug 28, 9:32 pm, saurabh singh saurab...@gmail.com wrote: @dave even '=' is an operator.I wonder if its possible to restrict *all operators*. On Sun, Aug 28, 2011 at 1:32 AM, Dave dave_and_da...@juno.com wrote: @Brijesh: Maybe you mean char *p; p = (char*)a; sum = (int)p[b]; // sum = a + b but is an operator. Dave On Aug 27, 2:07 pm, Brijesh brijeshupadhyay...@gmail.com wrote: How to add two nos without using any operator...? -- 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. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD- Hide quoted text - - Show quoted text - -- 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. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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. -- With Regards Manish Patel BTech Computer Science And Engineering National Institute of Technology -Allahabad -- 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: Adding Two no without using any operator...??
super Thank you, Sid. On Sun, Aug 28, 2011 at 7:42 AM, saurabh singh saurab...@gmail.com wrote: main() { int a=4,b=6; printf(\n%d\n,printf(%*s%*s,a,,b,)); } -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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.
Re: [algogeeks] Re: Adding Two no without using any operator...??
can you please tell me how is this working main() { int a=4,b=6; printf(\n%d\n,printf(%*s%*s,a,,b,)); } -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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. -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) -- sapraaks...@gmail.com akshatsapr...@gmail.com rit2009...@iiita.ac.in sapraaks...@facebook.com -- 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: Adding Two no without using any operator...??
@saurubh singhhow it is working ? plz explain the logic -- 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: Adding Two no without using any operator...??
printf returns the number of chars it puts on the stream %*s the * is replaced by %value of as that is shifted a times and similarly for b shifted by b times.The null string ensures that nothing unwanted is printed On Sun, Aug 28, 2011 at 7:22 PM, annarao kataru kataruanna...@gmail.comwrote: @saurubh singhhow it is working ? plz explain the logic -- 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. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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: Adding Two no without using any operator...??
@sourabh ; thank u very much -- 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: Adding Two no without using any operator...??
if we give a=10, b=5 we get a^b=15 but wen a=10,b=7 we get a^b=13 why s it so,..??? -- 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: Adding Two no without using any operator...??
Very nice solution sourabh. On Sun, Aug 28, 2011 at 9:52 PM, Dave dave_and_da...@juno.com wrote: @Shravanthi: Write a and b in binary, and then apply the bitwise exclusive-or to them and you will see why. Dave On Aug 28, 9:24 am, Shravanthi U M shravanthium...@gmail.com wrote: if we give a=10, b=5 we get a^b=15 but wen a=10,b=7 we get a^b=13 why s it so,..??? -- 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.
Re: [algogeeks] Re: Adding Two no without using any operator...??
But it works only for +ve numbers. Sanju :) On Sun, Aug 28, 2011 at 9:57 AM, Abhishek Yadav algowithabhis...@gmail.comwrote: Very nice solution sourabh. On Sun, Aug 28, 2011 at 9:52 PM, Dave dave_and_da...@juno.com wrote: @Shravanthi: Write a and b in binary, and then apply the bitwise exclusive-or to them and you will see why. Dave On Aug 28, 9:24 am, Shravanthi U M shravanthium...@gmail.com wrote: if we give a=10, b=5 we get a^b=15 but wen a=10,b=7 we get a^b=13 why s it so,..??? -- 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. -- 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: Adding Two no without using any operator...??
@dave even '=' is an operator.I wonder if its possible to restrict *all operators*. On Sun, Aug 28, 2011 at 1:32 AM, Dave dave_and_da...@juno.com wrote: @Brijesh: Maybe you mean char *p; p = (char*)a; sum = (int)p[b]; // sum = a + b but is an operator. Dave On Aug 27, 2:07 pm, Brijesh brijeshupadhyay...@gmail.com wrote: How to add two nos without using any operator...? -- 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. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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: Adding Two no without using any operator...??
amazing solution Saurabh. Thanks! -- B Anjaneyulu Reddy http://flavors.me/anjit6 +91 7259509827 On Mon, Aug 29, 2011 at 8:02 AM, saurabh singh saurab...@gmail.com wrote: @dave even '=' is an operator.I wonder if its possible to restrict *all operators*. On Sun, Aug 28, 2011 at 1:32 AM, Dave dave_and_da...@juno.com wrote: @Brijesh: Maybe you mean char *p; p = (char*)a; sum = (int)p[b]; // sum = a + b but is an operator. Dave On Aug 27, 2:07 pm, Brijesh brijeshupadhyay...@gmail.com wrote: How to add two nos without using any operator...? -- 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. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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.
Re: [algogeeks] Re: Adding Two no without using any operator...??
main() { int a=4,b=6; printf(\n%d\n,printf(%*s%*s,a,,b,)); } -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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.