home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
SNIP9404.ZIP
/
PLURALTX.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-03
|
404b
|
20 lines
/*
** PLURALTX.C - How to print proper plurals
**
** public domain - original algorithm by Bob Stout
*/
#include <stdio.h>
#define plural_text(n) &"s"[(1 == (n))]
#define plural_text2(n) &"es"[(1 == (n)) << 1]
void main(void)
{
int i;
for (i = 0; i < 10; ++i)
printf("%d thing%s in %d box%s\n", i, plural_text(i),
i, plural_text2(i));
}