Article View: comp.lang.c
Article #1101Re: Taming The Switch-Statement
From: Rosario19
Date: Thu, 29 Oct 2026 07:41
Date: Thu, 29 Oct 2026 07:41
24 lines
2210 bytes
2210 bytes
On Thu, 29 Oct 2026 08:38:06 +0100, Rosario19 <Ros@invalid.invalid>
wrote:
>On Thu, 29 Oct 2026 08:30:33 +0100, Rosario19 wrote:
>
>>for(x=1;x<20;++x)
>> {if(x%2==0) printf("%d divides by 2\n",x);
>> if(x%3==0) printf("%d divides by 3\n",x);
>> if(x%3!=0&&x%2!=0)
>> printf("%d no divides (by 3 or 2)\n",x);
>> }
>
>
>int y,x=0;
>label:
>y=1;++x;
>if(x%2==0) {printf("%d divides by 2\n",x);y=0;}
>if(x%3==0) {printf("%d divides by 3\n",x);y=0;}
>if(y)printf("%d no divides (by 3 or 2)\n",x);
>if(x<20)goto label;
if(x<19)goto label,
x is 18, goes in label print 19
19 exit
Technical Details
Message-ID:
<02u5elt16t1jurth9bomrgl7a41u1jn2tc@4ax.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <11ba02r$3pl5h$1@dont-email.me> <11bnfpm$i84l$1@dont-email.me> <11bng23$iblc$1@dont-email.me> <11bngj1$ifj5$1@dont-email.me> <11bnnbg$l7i1$1@dont-email.me> <11bntk0$nsbo$1@dont-email.me> <11bnvbq$olbj$1@dont-email.me> <11bo02r$otr5$1@dont-email.me> <11bo0ul$pbso$1@dont-email.me> <11bo1bc$phlr$1@dont-email.me> <tft5elp1q2ns7rhfp3rod862ks5ip3p0ms@4ax.com> <4mt5el592m8ibmgik0fsdg28i29kvpuo6i@4ax.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Rosario19 <Ros@invalid.invalid> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Thu, 29 Oct 2026 08:41:04 +0100 Organization: A noiseless patient Spider Lines: 24 Message-ID: <02u5elt16t1jurth9bomrgl7a41u1jn2tc@4ax.com> References: <119qf6l$2rmg3$1@dont-email.me> <11ba02r$3pl5h$1@dont-email.me> <11bnfpm$i84l$1@dont-email.me> <11bng23$iblc$1@dont-email.me> <11bngj1$ifj5$1@dont-email.me> <11bnnbg$l7i1$1@dont-email.me> <11bntk0$nsbo$1@dont-email.me> <11bnvbq$olbj$1@dont-email.me> <11bo02r$otr5$1@dont-email.me> <11bo0ul$pbso$1@dont-email.me> <11bo1bc$phlr$1@dont-email.me> <tft5elp1q2ns7rhfp3rod862ks5ip3p0ms@4ax.com> <4mt5el592m8ibmgik0fsdg28i29kvpuo6i@4ax.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Thu, 29 Oct 2026 07:33:09 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3295406"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jUtAbQ/Vg1ACPBmRpv1nhKtRE2253N48="; posting-host="7cd7d0c5bc9169077a92d3388a16dbd9" Cancel-Lock: sha1:rJvtkeBRslUnnISnUwWs9Mt4d08= sha256:nliNMpEJPYQWUh4rxh7QeM90HPeEeINoE1u+x4VJ7Ic= sha1:qPsbuPODCQqWYevFnGEB1Sab4Lo= sha256:PewpHNvej0W+2r8L1XeYNLeHH32Cgcml1hTZ2PRD+U4= X-Newsreader: Forte Free Agent 1.93/32.576 English (American)