Computer Science Canada

printf("help!");

Author:  blissfullydysphoric [ Tue Sep 16, 2008 9:07 pm ]
Post subject:  printf("help!");

Sorry bad joke.. anyways i was wondering how to print the % sign in the printf command. When I put
code:

        printf("Please enter the interest rate on the investment: %");

where i want the % sign to be infront of the input the user enters.

it gives me an error because the % sign shouldn't be there.

Author:  [Gandalf] [ Tue Sep 16, 2008 9:18 pm ]
Post subject:  RE:printf("help!");

Use a double %, ie. instead of % use %%.

Author:  blissfullydysphoric [ Wed Sep 17, 2008 9:21 am ]
Post subject:  RE:printf("help!");

Thanks I'll do that!


: