Newbie at programming (for now) and in need of help

This is a discussion on Newbie at programming (for now) and in need of help within the C Programming forums, part of the General Programming Boards category; Probably because convertPrint is not calling convertFahrenheit correctly. What is the current code state?...

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Probably because convertPrint is not calling convertFahrenheit correctly. What is the current code state?

  2. #17
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Winner winner chicken dinner.....

    Code:
    #include <stdlib.h>
    #include <stdio.h>
    
    double convertFahrenheit(double value);
    double convertPrint(double value);
    
    int main(void)
    {
        convertPrint(212);
        return 0;
    }
    
    
    double convertPrint(double value)
    {
        double temp;
    
    
        temp = convertFahrenheit(value);
        printf("Your tempurature in Fahrenheit is &#37;.2f", temp);
    
        return temp;
    }
    
    double convertFahrenheit(double value) { return (((value - 32.0 ) * 5.0) / 9.0); }

  3. #18
    Registered User
    Join Date
    Oct 2008
    Posts
    21
    ohh wasn't paying attention to the bold font, more towards the red numbers. my bad. thanks for the help though, it works now

  4. #19
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Quote Originally Posted by cleepy View Post
    ohh wasn't paying attention to the bold font, more towards the red numbers. my bad. thanks for the help though, it works now
    Well yeah I'm not going to give you a non working implementation.. lol

  5. #20
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You could probably make your temperature conversion a macro instead. But I see no need to make life even more confusing for you.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

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