Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    twanx
    twanx's Avatar
    Guest

    C Programming: Write a statement that reads a floating point (real) value...

    ...from standard input into...? Write a statement that reads a floating point (real) value from standard input into temperature. Assume that temperature. has already been declared as an double variable.

    So far, I wrote:

    scanf("%f", &temperature);

    but it's not right according to my online homework. The correction says that the %f part is not right. I tried %d and it didn't work either. Any clues?

    Thanks.

  2. #2
    Unregistered1234567890
    Unregistered1234567890's Avatar
    Guest

    Re: C Programming: Write a statement that reads a floating point (real) value...

    u need %lf for double and a space between the double quote and your placeholder when working with scanf.

    scanf(" %lf", &temperature);

    i have the same problem for my hw.

 

 

Quick Reply Quick Reply

Click here to log in


How many letters in the word Rabroad

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PHP if statement programming help?
    By Shadowcaz in forum Discuss PHP
    Replies: 0
    Last Post: 02-24-2011, 04:05 AM
  2. Why do most CPU designs include a dedicated floating point unit?
    By Clueless Interests in forum Discuss Photography
    Replies: 0
    Last Post: 02-23-2011, 06:02 AM
  3. Represent +1.7, -.012 in floating point number representation.?
    By cloud in forum Discuss Painting and Sculpture
    Replies: 0
    Last Post: 11-18-2010, 05:18 AM
  4. how can you represent a floating point number in terms of bytes?
    By Bob in forum Discuss Painting and Sculpture
    Replies: 0
    Last Post: 09-13-2010, 08:11 AM
  5. Replies: 0
    Last Post: 07-08-2010, 11:22 AM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •