Thread: I'm new to progamming. I'm not a student. not hom Just tring to see what i did wrong!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    1

    Talking I'm new to progamming. I'm not a student. not hom Just tring to see what i did wrong!

    This is my code and i dont know what i did wrong.
    When I run it; It ask for a number the it says the result is celcius.
    If any one can please do. Feel free to try the code your self

    [html]
    [body]
    [tag]
    Code:
    //
    // Conversion - Program to convert temperature from
    //              Fahrenheit degreees into Celcius:
    //              Fahrenheit = Celcius  9/5 + 32 =
    //
    #include <cstdio>
    #include <cstdlib>
    #include <iostream>
    using namespace std;int main (int nNumberofargs, char* pszArgs [] )
    {
      // enter the tempature in Fahrenheit
      int Fahrenheit;
      cout << "Enter the tepature in Fahrenheit:";
      cin >> Fahrenheit;
      // Use conversion factor for Fahrenheit
      // to Celcius
      int factor;
      factor = 5 + 32 ;
      // use conversion factor to convert Fahrenheit
      // into Celcius values
      int fahrenheit;
      fahrenheit = factor * Fahrenheit/5+32;
      // output the results (followed "by a Newline)
      cout << "Celcius value is:" ;
      cout >> celcius << endl;
      // wait until user is read before terminating program
      // to allow the user see the program results
      system("PAUSE");
      return 0;
     }
    [/tag]
    [/body]
    [/html]
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. new student
    By monu in forum C Programming
    Replies: 2
    Last Post: 07-25-2007, 12:47 AM
  2. error when tring to run program
    By hopeolicious in forum C++ Programming
    Replies: 3
    Last Post: 02-28-2005, 01:06 AM
  3. tring to sort file along with converting it from char to int
    By tony24tone in forum C++ Programming
    Replies: 2
    Last Post: 04-14-2004, 06:39 AM
  4. new to c progamming any one can help
    By manalidris in forum C Programming
    Replies: 1
    Last Post: 05-13-2002, 05:05 AM
  5. tring again..
    By xlordt in forum C Programming
    Replies: 6
    Last Post: 02-17-2002, 05:01 PM