Thread: Displaying a table of arbitrary values?

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    1

    Displaying a table of arbitrary values?

    So I'm trying to write code that will display this table:
    Time Frequency
    0 5.00000040
    100 5.00000095
    200 5.00000230
    300 5.00001800
    400 5.00000870
    500 5.00000065
    600 5.00000370

    I have the "time" table down fine, (im using a for statement that requires time = 0; time <= 600; time += 100) and its displaying fine. I just don't understand how I can get Frequency to display an arbitrary value like those above, and also display on the sime line as the "times" Can anyone help please?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    What is arbitrary value? any value from -1.7E +308 to 1.7E +308?


    to print 2 values on the same line use:

    Code:
    int time = 100;
    double value = 5.00001800;
    printf("&#37;d %10.8f\n",time,value);
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Table of X & Y Values.
    By danlee58 in forum C Programming
    Replies: 5
    Last Post: 10-15-2008, 04:29 AM
  2. A table for errno values by linux sockets?
    By hardi in forum Networking/Device Communication
    Replies: 2
    Last Post: 12-20-2006, 02:10 PM
  3. need some advice on displaying values
    By rEtard in forum Windows Programming
    Replies: 7
    Last Post: 06-16-2005, 09:55 AM
  4. extra word printing
    By kashifk in forum C++ Programming
    Replies: 2
    Last Post: 10-25-2003, 04:03 PM
  5. inputting words from a file
    By kashifk in forum C++ Programming
    Replies: 5
    Last Post: 10-24-2003, 07:18 AM