Thread: about printf

  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;
    prýntf("%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, 10:14 AM