#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2017
    Posts
    2
    Rep Power
    0

    Temperature Converter


    Hey! Totally new at this and the book that I am using is not of much help. Can anyone help with this:

    #include
    #include<iostream.h>
    main()
    {clrscr();
    int c, f;
    cout<<"Welcome, this program converts Celsius to Fahrenheit"\n;
    cout<<"Enter the degree in Celsius:";
    cin>>c:
    f=c*1.8+32;
    cout<<"The degree in Fahrenheit is"<<f;
    getch();
    return 0;
    }

    An error keeps popping up about the #include<iostream.h> but the book just assumes that I won't have any trouble.

    Appreciated.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2017
    Posts
    2
    Rep Power
    0
    Resolved.
  4. #3
  5. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,473
    Rep Power
    1875
    If your book mentions #include<iostream.h>, then it's 20 years out of date.

    #include<iostream.h> officially became #include<iostream> in 1998.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo