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

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    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.

Popular pages Recent additions subscribe to a feed