about printf

This is a discussion on about printf within the C Programming forums, part of the General Programming Boards category; hi all, i m trying to print more than 6 digits after the point.(ex: 0.00000768) but i cant do this. ...

  1. #1
    unregistered
    Guest

    Question about printf

    hi all,

    i m trying to print more than 6 digits after the point.(ex: 0.00000768)

    but i cant do this.

    for example
    .....
    double x;
    x=0.00000764;
    prntf("%f", x);
    ....

    this program prints 0.000008.but i want to prin 0.000007 or 0.00000764(this numbers are just examples)

    what should i do??

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    87
    Hi, this should work

    Code:
    printf("%.8f\n",x);
    PuterPaul.co.uk - Portfolio site

  3. #3
    Unregistered
    Guest

    Talking thanks

    thankss

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. making it portable.....?
    By ShadeS_07 in forum C Programming
    Replies: 11
    Last Post: 12-24-2008, 09:38 AM
  2. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  3. segmentation fault upon reload
    By yabud in forum C Programming
    Replies: 8
    Last Post: 12-18-2006, 06:54 AM
  4. Simple C question: user input to repeat a loop
    By evernaut in forum C Programming
    Replies: 2
    Last Post: 11-18-2006, 09:23 AM
  5. Drawing tables in C
    By stanoman in forum C Programming
    Replies: 5
    Last Post: 10-09-2003, 11:14 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21