Menu

Temp Conversion Noob question!

2009-01-24
2012-09-26
  • Andrew Charbonneau

    I'm very new to dev C and I wanted to make a program that converts degree kelvin to degree celsius to degree farnheit, this is what I have so far:

    include <stdio.h>

    int main()
    {

    / variables to contain temperature values/
    float degreeK, degreeC, degreeF;

    printf("Enter a Temperature in degrees Kelvin: ");

    /Read a value into degreeK/
    scanf("%f", &degreek);

    /Assign degreeK-273.2 to degreeC/
    degreeC = degreeK-273.2;

    /Assign (degreeC9/5) + 32/
    degreeF = (degreeC
    9/5) + 32;

    /Prints corresponding temperatures in degrees celsius then degrees farenheit/

    printf("The temperature in degrees celsius is %f C and the temperature in degree farenheit is %f F\n",degreeC,degreeF);

    system("pause");

    return (0);

    }

    It keeps giving me an error at the scanf part.

    Please Help!

     
    • Andrew Charbonneau

      WOOOPSIE I knew C is case sensitive but I must have overlooked that, thanks!

       
    • Musa

      Musa - 2009-01-24

      are you aware that C is cAsE sEnSiTiVe
      degreek != degreeK

       
    • Andrew Charbonneau

      WOOOPSIE I knew C is case sensitive but I must have overlooked that, thanks!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.