We've partnered up with to offer a space where you can talk directly to Peter from and get an exclusive discount code for a free job listing. If you are recruiting or know anyone else who is please check out the forum here.
If you have a new account but can't post, please email Niamh on [email protected] for help to verify your email address. Thanks :)

Temp conversion with c useing dev++

  • 30-09-2016 9:55pm
    Registered Users Posts: 35 ✭✭✭ techintraining


    I am learning c, new to programing, any help with following would be much appreciated. Keeps giving me the answer 0.000000000:mad::mad::mad:

    #include <stdio.h>

    int main()


    float celsius=0;
    float fahrenheit=0;

    printf("please enter a tempture in fahrenhiet \n");
    printf("-->number must be from -500 to 1000 \n\n");
    printf("****range is from -500 to 1000****\n");
    scanf("%f", &fahrenheit);

    printf("invlid number range\n\a");

    else {
    celsius = faherheit -32 (5.0/9.0) *5 ;
    printf("\nThe answer in celcius is ---->> %f", &celsius);
    return 0;


  • Registered Users Posts: 2,423 ✭✭✭ ressem

    4 errors in this line
    celsius = faherheit -32 (5.0/9.0) *5 ;

    1 spelling error, and 3 errors in the conversion formula.

    If fahrenheit is 212 then celsius should be 100.

    Really important for a starter programmer to learn how to use the debug, breakpoint, step and inspect variable.

    Loads of videos on youtube using dev c++. This one is less than 3 minutes.

  • Registered Users Posts: 35 ✭✭✭ techintraining

    Thank's :)