Article View: comp.lang.c
Article #1181Re: BizFuss (was Re: Taming The Switch-Statement)
From: Keith Thompson
Date: Fri, 30 Oct 2026 19:04
Date: Fri, 30 Oct 2026 19:04
25 lines
2373 bytes
2373 bytes
Lawrence D’Oliveiro <ldo@nz.invalid> writes:
> 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);
>> }
>
> Generalization I call “bizzfuzz” -- substitute whatever
> factors and limit you want:
>
> factors = (2, 3, 5, 7) # factors to be checked in order
> limit = 200
>
> for n in range(1, limit + 1) :
[SNIP]
comp.lang.python is down the hall, just past the water cooler, on
the left.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Technical Details
Message-ID:
<11c2poh$gqls$2@kst.eternal-september.org>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!kst.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> <11c1kee$2lqi$2@dont-email.me>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!kst.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: BizFuss (was Re: Taming The Switch-Statement) Date: Fri, 30 Oct 2026 12:04:48 -0700 Organization: None to speak of Lines: 25 Message-ID: <11c2poh$gqls$2@kst.eternal-september.org> 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> <11c1kee$2lqi$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 30 Oct 2026 19:04:49 +0000 (UTC) Injection-Info: kst.eternal-september.org; logging-data="551612"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XkZdrHfxQ36WsdQd708ye"; posting-host="b68af1aa9e7aa641ae7946e50ae9a9d4" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:cgZGDox2BUELOZxsftEKzO2e5QA= sha256:suCfDpdBGBOpPzbVF57yjv4s8DQLiqAax7oeOYOMDrg= sha1:XWW75ujoVF1OGi8RVf6JE5wNi3U= sha256:5CRpK8dcvLzFQeUpSnMTi9ZQ19vA943d9ebluzUustY=