Re: [algogeeks] printing without loop
Hey Guys, @preetikatyagi : The question is pretty straight Write a program printing number 1 to 100 without using any loop, GOTO statement , do while recursion @sunny : We have to come up with one one logic not each time we have to change how we can add number's to make 100. It has to be with caller to decide how many number he has to print the definition will take care of algorithm. *Subhransu Panigrahi * *Mobile:* *+91-9840931538* *Email:* subhransu.panigr...@gmail.com On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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] printing without loop
write printf statemen 100 times. lolzzz On Tue, Mar 1, 2011 at 2:01 PM, Subhransu subhransu.panigr...@gmail.comwrote: Hey Guys, @preetikatyagi : The question is pretty straight Write a program printing number 1 to 100 without using any loop, GOTO statement , do while recursion @sunny : We have to come up with one one logic not each time we have to change how we can add number's to make 100. It has to be with caller to decide how many number he has to print the definition will take care of algorithm. *Subhransu Panigrahi * *Mobile:* *+91-9840931538* *Email:* subhransu.panigr...@gmail.com On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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. -- best wishes!! Vaibhav Shukla DU-MCA -- 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] printing without loop
simply use GOTO On Tue, Mar 1, 2011 at 3:40 PM, vaibhav shukla vaibhav200...@gmail.comwrote: write printf statemen 100 times. lolzzz On Tue, Mar 1, 2011 at 2:01 PM, Subhransu subhransu.panigr...@gmail.comwrote: Hey Guys, @preetikatyagi : The question is pretty straight Write a program printing number 1 to 100 without using any loop, GOTO statement , do while recursion @sunny : We have to come up with one one logic not each time we have to change how we can add number's to make 100. It has to be with caller to decide how many number he has to print the definition will take care of algorithm. *Subhransu Panigrahi * *Mobile:* *+91-9840931538* *Email:* subhransu.panigr...@gmail.com On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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. -- best wishes!! Vaibhav Shukla DU-MCA -- 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] printing without loop
i think,just as in the previous algorithm in place of couti++ if we put coutprintf then we can get the required output. On Tue, Mar 1, 2011 at 3:41 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: simply use GOTO On Tue, Mar 1, 2011 at 3:40 PM, vaibhav shukla vaibhav200...@gmail.comwrote: write printf statemen 100 times. lolzzz On Tue, Mar 1, 2011 at 2:01 PM, Subhransu subhransu.panigr...@gmail.comwrote: Hey Guys, @preetikatyagi : The question is pretty straight Write a program printing number 1 to 100 without using any loop, GOTO statement , do while recursion @sunny : We have to come up with one one logic not each time we have to change how we can add number's to make 100. It has to be with caller to decide how many number he has to print the definition will take care of algorithm. *Subhransu Panigrahi * *Mobile:* *+91-9840931538* *Email:* subhransu.panigr...@gmail.com On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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. -- best wishes!! Vaibhav Shukla DU-MCA -- 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
Re: [algogeeks] printing without loop
This is awesome On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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] printing without loop
@sunny This is awesome On Tue, Mar 1, 2011 at 6:25 PM, priya mehta priya.mehta...@gmail.comwrote: This is awesome On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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] printing without loop
yes..the solution given by sunny is awesome...well done !! On Tue, Mar 1, 2011 at 6:25 PM, priya mehta priya.mehta...@gmail.comwrote: @sunny This is awesome On Tue, Mar 1, 2011 at 6:25 PM, priya mehta priya.mehta...@gmail.comwrote: This is awesome On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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] printing without loop
#includeiostream int i=1; int main() { printf(%d\n,i++); return i==101?0:main(); } On 3/1/11, Logic King crazy.logic.k...@gmail.com wrote: yes..the solution given by sunny is awesome...well done !! On Tue, Mar 1, 2011 at 6:25 PM, priya mehta priya.mehta...@gmail.comwrote: @sunny This is awesome On Tue, Mar 1, 2011 at 6:25 PM, priya mehta priya.mehta...@gmail.comwrote: This is awesome On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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. -- Himanshu Sachdeva -- 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] printing without loop
#include stdio.h #include stdlib.h int main(int argc, char *argv[]) { if(printf(1 ))if(printf(2 ))if(printf(3 ))if(printf(4 ))if(printf(5 ))if(printf(6 ))if(printf(7 )){} system(PAUSE); return 0; } On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Regards, Kamakshi kamakshi...@gmail.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] printing without loop
Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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] printing without loop
@Sunny nice solution. But can you generalize this for x without any loop to be more clear write a function which prints 1 to n without any loop. print( int n ) for n how will you calculate what all PRINTk are required ? On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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] printing without loop
I would request you to read previous threads before posting your answer. It is clearly mentioned that you can't use any loop( for, while, do-while, goto ) and recursion. I On Tue, Mar 1, 2011 at 3:41 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote: simply use GOTO On Tue, Mar 1, 2011 at 3:40 PM, vaibhav shukla vaibhav200...@gmail.comwrote: write printf statemen 100 times. lolzzz On Tue, Mar 1, 2011 at 2:01 PM, Subhransu subhransu.panigr...@gmail.comwrote: Hey Guys, @preetikatyagi : The question is pretty straight Write a program printing number 1 to 100 without using any loop, GOTO statement , do while recursion @sunny : We have to come up with one one logic not each time we have to change how we can add number's to make 100. It has to be with caller to decide how many number he has to print the definition will take care of algorithm. *Subhransu Panigrahi * *Mobile:* *+91-9840931538* *Email:* subhransu.panigr...@gmail.com On Tue, Mar 1, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote: int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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. -- best wishes!! Vaibhav Shukla DU-MCA -- 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
Re: [algogeeks] printing without loop
for general case to print i to n create a class with one static member i initialized to 0 in constructor of the class increment i and print i create n objects of the class in main -- 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] printing without loop
Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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] printing without loop
Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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] printing without loop
May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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] printing without loop
int i=1; #define PRINT1 couti++endl; #define PRINT2 PRINT1 PRINT1 #define PRINT4 PRINT2 PRINT2 #define PRINT8 PRINT4 PRINT4 #define PRINT16 PRINT8 PRINT8 #define PRINT32 PRINT16 PRINT16 #define PRINT64 PRINT32 PRINT32 int main() { //as 100 = (1100100); we need to use PRINT64, PRINT32, and PRINT4 PRINT64; PRINT32; PRINT4; } This will print 1 to 100. You can use this code to print from 1 to x (x=128). You can extend it to larger numbers, by adding PRINT128, PRINT256...etc. On 3/1/11, preetika tyagi preetikaty...@gmail.com wrote: May be we can use *goto *statement? On Mon, Feb 28, 2011 at 10:36 PM, gaurav gupta 1989.gau...@googlemail.comwrote: Questions is : You have to print 1 to n without using any loop( for, while, do-while, goto ) and recursion. Any suggestion? On Tue, Mar 1, 2011 at 10:52 AM, preetika tyagi preetikaty...@gmail.comwrote: Can you elaborate on it and provide more details? On Mon, Feb 28, 2011 at 10:14 PM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: Is there any way to print 1 to 10 (taking an example, it can also extend to 100) without using loop, recursion. Sent from my iPhone -- 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. -- Thanks Regards, Gaurav Gupta 7676-999-350 Quality is never an accident. It is always result of intelligent effort - John Ruskin -- 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. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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.