Thread: question

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    39

    question

    scanf(“%f%%”, &percent);

    what is the %% used for ?

  2. #2
    Registered User
    Join Date
    Apr 2012
    Posts
    39
    so taht if i enter 56 % the percentage sign is stored or removed ?

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    read scanf - C++ Reference

    Then code the program and test the results.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #4
    Registered User
    Join Date
    Mar 2012
    Location
    the c - side
    Posts
    373
    % is used for formatting information by scanf, but sometimes you also want to print out "%" as a character - to do that you use it twice '%%' like in your code.

  5. #5
    Registered User
    Join Date
    Mar 2012
    Location
    the c - side
    Posts
    373
    ummmm.... that should have read "input" rather than "print out"

  6. #6
    Registered User
    Join Date
    Mar 2012
    Location
    the c - side
    Posts
    373
    ummmmm.... actually sorry, that's tosh just ignore it all. need to cut down on the multi-tasking and pay attention!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-23-2011, 09:00 AM
  2. *szString = things question/memory question
    By Jang in forum C Programming
    Replies: 3
    Last Post: 01-20-2011, 04:59 AM
  3. Newbish Question file reading question....
    By kas2002 in forum C Programming
    Replies: 23
    Last Post: 05-17-2007, 12:06 PM
  4. Self regiserting DLLs question and libraries question.
    By ApocalypticTime in forum Windows Programming
    Replies: 2
    Last Post: 03-22-2003, 02:02 PM
  5. A question of color...(not a racial question)
    By Sebastiani in forum Windows Programming
    Replies: 7
    Last Post: 01-15-2003, 08:05 PM