Need help with this

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
float celsius, fahrenheit, kelvin;

cout << setw(15) << "Celsius" << setw(15) <<setw(15) << "Kelvin" <<endl;

for(celsius=0;celsius<-25;celsius=celsius+1) {

fahrenheit = (9/5.) * celsius + 32;
kelvin = celsius + 273.;

cout << setw(15) << celsius << setw(18) << fahrenheit << setw(15) << kelvin << endl;
}

system("PAUSE");
}






The errors are:

1>------ Build started: Project: fgjhg, Configuration: Debug Win32 ------
1> stdafx.cpp
1> fgjhg.cpp
1>c:\users\jake\documents\visual studio 2010\projects\fgjhg\fgjhg\fgjhg.cpp(1): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\jake\documents\visual studio 2010\projects\fgjhg\fgjhg\fgjhg.cpp(2): warning C4627: '#include <iomanip>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\jake\documents\visual studio 2010\projects\fgjhg\fgjhg\fgjhg.cpp(21): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I don't know if this is enough info to be able to help me but please try as much as you can
You created a project without clicking the empty project box.

Right click on project name --> properties -- > c/c++ --> precompiled headers --> it will say precompiled header : Yes.
Click on the yes to change it to a no.

That beeing done it will not fix the code.
You use a float for the variables but have initialized them as whole numbers (int).
Type in 9.0f/5.0f etc etc.

That will not complete the code, it will just print out celcius and fahrenheit, no numbers no nothing. Keep it up!

Topic archived. No new replies allowed.