Results 1 to 3 of 3

Thread: Format specifiers in C

  1. #1
    Contributing Member
    Join Date
    May 2006
    Answers
    64

    Format specifiers in C

    Some of the format specifiers which I am aware of in C is %d, %f, %s, %c.Is there any other format specifier available? If so let me know about it.


  2. #2
    Contributing Member
    Join Date
    May 2006
    Answers
    85

    Re: Format specifiers in C

    Janelyn there are yet many format specifiers apart from the one mentioned by you. They are
    %c single character
    %d and %i both used for integer type
    %u used for representing unsigned integer
    %o octal integer unsigned
    %x,%X used for representing hex unsigned integer
    %e, %E, %f, %g, %G floating type
    %s strings that is sequence of characters


  3. #3
    Expert Member
    Join Date
    May 2008
    Answers
    100

    Thumbs up Re: Format specifiers in C

    format specifiers for integer data type

    short signed %d or %i
    short unsigned %u
    long signed %ld
    long unsigned %lu
    unsigned hexadecimal %x
    unsigned octal %o

    format specifiers for real data type

    float %f
    double %lf

    format specifiers for character/string data type

    signed character %c
    unsigned character %c
    string %s

    Last edited by aman15490; 02-18-2010 at 09:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact