Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!elroy.jpl.nasa.gov!decwrl!mcnc!duke!drh From: drh@duke.cs.duke.edu (D. Richard Hipp) Newsgroups: comp.lang.c Subject: Re: print % in c Message-ID: <667519758@romeo.cs.duke.edu> Date: 25 Feb 91 22:09:19 GMT References: <61516@eerie.acsu.Buffalo.EDU> <1991Feb25.180600.5004@ux1.cso.uiuc.edu> Organization: Duke University Computer Science Dept.; Durham, N.C. Lines: 12 In article <1991Feb25.180600.5004@ux1.cso.uiuc.edu> gordon@osiris.cso.uiuc.edu (John Gordon) writes: > To print special characters with printf(), precede the character >with a \ character. Example: > > printf("This a percent sign: \%\n"); > printf("This is a backslash: \\\n"); Nope. John is wrong here. To print a % using printf, put two %'s in a row, like this: printf("This is a percent sign: %%\n");