Re: [algogeeks] Re: debugging contest
xxx, yyy are considered as cases? -- 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: debugging contest
None of the statements except those inside the 'case' executesaccording to the input, the default case gets executed which is the inner switch which prints nine.. On Wed, Mar 23, 2011 at 8:46 PM, cegprakash cegprak...@gmail.com wrote: i=9; switch(i){ xxx: printf(default); yyy:printf(hello); asdfasdf: printf(why no errors and why not printed); case '1': printf(one); default: switch(i){ case '1': printf(one); break; case '2': printf(two); break; case 9: printf(nine); break; } break; } the output is nine why no errors for the above code? now someone tell what are the dummy labels xxx yyy and why they are not executed? -- 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. -- A.Balaji -- 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: debugging contest
is there any use with labels xxx, yyy.. ? -- 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: debugging contest
When you want to use the *infinitely abusable goto statement then you need those labels* On Sat, Mar 26, 2011 at 8:57 PM, Prakash D IT @ CEG cegprak...@gmail.comwrote: is there any use with labels xxx, yyy.. ? -- 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.
[algogeeks] Re: debugging contest
why do i get one after default? -- 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: debugging contest
since u havnt written da break statement...the case '1' also gets executed..and then when the break statement is encountered..the control comes out of the switch case On Wed, Mar 23, 2011 at 8:27 PM, cegprakash cegprak...@gmail.com wrote: why do i get one after default? -- 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: debugging contest
bcoz '9'!=9.Anything within ' '(single quotes) is a character and not int On Wed, Mar 23, 2011 at 8:27 PM, cegprakash cegprak...@gmail.com wrote: why do i get one after default? -- 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.
[algogeeks] Re: debugging contest
i is not equal to '1' i=1 which is equialent to 49 -- 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: debugging contest
sorry i meant '1'=49 and 9 is not 49 but how we get one -- 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: debugging contest
i=9; switch(i){ default: printf(default); case 9: printf(one); break; case '2': printf(two); break; case '9': printf(nine); break; } but how the hell we get output for the above code as one .. why default not printed -- 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: debugging contest
now the case 9 is matching so it gets executed...n da break statement is encountered... On Wed, Mar 23, 2011 at 8:35 PM, cegprakash cegprak...@gmail.com wrote: i=9; switch(i){ default: printf(default); case 9: printf(one); break; case '2': printf(two); break; case '9': printf(nine); break; } but how the hell we get output for the above code as one .. why default not printed -- 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: debugging contest
@cegprakash Relax shut down your computer for some time and switch on your i-pod.:) On Wed, Mar 23, 2011 at 8:37 PM, cegprakash cegprak...@gmail.com wrote: now i got it.. first it checks whether it matches with any case. If it matches it starts executing from that case until it encounters a break. if it doesn't matches with any case then it starts executing from default and starts executing until a break. -- 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: debugging contest
@cegprakash Relax shut down your computer for some time and switch on your i-pod.:) On Wed, Mar 23, 2011 at 8:39 PM, saurabh singh saurab...@gmail.com wrote: @cegprakash Relax shut down your computer for some time and switch on your i-pod.:) On Wed, Mar 23, 2011 at 8:37 PM, cegprakash cegprak...@gmail.com wrote: now i got it.. first it checks whether it matches with any case. If it matches it starts executing from that case until it encounters a break. if it doesn't matches with any case then it starts executing from default and starts executing until a break. -- 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 -- 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: debugging contest
ascii values da...not 9 On Wed, Mar 23, 2011 at 8:39 PM, saurabh singh saurab...@gmail.com wrote: @cegprakash Relax shut down your computer for some time and switch on your i-pod.:) On Wed, Mar 23, 2011 at 8:39 PM, saurabh singh saurab...@gmail.comwrote: @cegprakash Relax shut down your computer for some time and switch on your i-pod.:) On Wed, Mar 23, 2011 at 8:37 PM, cegprakash cegprak...@gmail.com wrote: now i got it.. first it checks whether it matches with any case. If it matches it starts executing from that case until it encounters a break. if it doesn't matches with any case then it starts executing from default and starts executing until a break. -- 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 -- 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.
[algogeeks] Re: debugging contest
i=9; switch(i){ xxx: printf(default); yyy:printf(hello); asdfasdf: printf(why no errors and why not printed); case '1': printf(one); default: switch(i){ case '1': printf(one); break; case '2': printf(two); break; case 9: printf(nine); break; } break; } the output is nine why no errors for the above code? now someone tell what are the dummy labels xxx yyy and why they are not executed? -- 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: debugging contest
Write switch and you will get error.They are not treated as labels.Read about : operator. On Wed, Mar 23, 2011 at 8:46 PM, cegprakash cegprak...@gmail.com wrote: i=9; switch(i){ xxx: printf(default); yyy:printf(hello); asdfasdf: printf(why no errors and why not printed); case '1': printf(one); default: switch(i){ case '1': printf(one); break; case '2': printf(two); break; case 9: printf(nine); break; } break; } the output is nine why no errors for the above code? now someone tell what are the dummy labels xxx yyy and why they are not executed? -- 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.
[algogeeks] Re: debugging contest
what is the use of labels in switch -- 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: debugging contest
sorry i mean case On Wed, Mar 23, 2011 at 8:49 PM, saurabh singh saurab...@gmail.com wrote: Write switch and you will get error.They are not treated as labels.Read about : operator. On Wed, Mar 23, 2011 at 8:46 PM, cegprakash cegprak...@gmail.com wrote: i=9; switch(i){ xxx: printf(default); yyy:printf(hello); asdfasdf: printf(why no errors and why not printed); case '1': printf(one); default: switch(i){ case '1': printf(one); break; case '2': printf(two); break; case 9: printf(nine); break; } break; } the output is nine why no errors for the above code? now someone tell what are the dummy labels xxx yyy and why they are not executed? -- 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 -- 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.