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 wrote:
> is there any use with labels xxx, yyy.. ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" gr
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.
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 wrote:
> i=9;
>switch(i){
> xxx: printf("default");
>
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
sorry i mean case
On Wed, Mar 23, 2011 at 8:49 PM, saurabh singh 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 wrote:
>
>> i=9;
>>switch(i){
>> xxx: printf("default");
>
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 mo
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 wrote:
> i=9;
>switch(i){
> xxx: printf("default");
> yyy:printf("hello");
> asdfasdf: printf("why no errors and why
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;
ascii values da...not 9
On Wed, Mar 23, 2011 at 8:39 PM, saurabh singh 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 wrote:
>
>> @cegprakash Relax shut down your computer for some time and
@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 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 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 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
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 wrote:
>
>i=9;
>switch(i){
> default: printf("default");
> case 9: printf("one"); break;
> case '2': printf("two");
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
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 pri
ryt..since none of the cases match so default case is executed,..but since u
havnt placed break aftr dat..case '1' too gets executed..evn if u didnt
intend to do so..dats y da output "defaultone"
On Wed, Mar 23, 2011 at 8:31 PM, cegprakash wrote:
> i is not equal to '1'
> i=1 which is equialent
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...@go
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...@googlegro
bcoz '9'!=9.Anything within ' '(single quotes) is a character and not
int
On Wed, Mar 23, 2011 at 8:27 PM, cegprakash 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 g
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 wrote:
> why do i get "one" after "default"?
>
> --
> You received this message beca
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 mo
20 matches
Mail list logo