Have a program I was working on that would make a charter converting Farenheit to Celius I would like to use the for loop here is my cody so far. Sorry if it is not even close.
#include <iostream>
using namespace std;
#include <iomanip>
int ConvertFarenheitToCelcius(int);
int Farenheit(int);
int Celsius(int);
int i;
int main()
{
for(int i = 0;i< 100;i++)
cout << Celsius(i) << " " << Farenheit(i) << endl;
}
int Celsius(int i)
{
Farenheit = (1.8*i)+32;
return Farenheit;
}
int Farenheit(int i)
{
Celsius(i) = ( Farenheit-32)/1.8;
#include <iostream>
usingnamespace std;
#include <iomanip>
int ConvertFarenheitToCelcius(int);
int Farenheit(int);
int Celsius(int);
// int i; You don't need this
int main()
{
for(int i = 0;i< 100;i++)
cout << Celsius(i) << " " << Farenheit(i) << endl;
// } extra brace
// function definitions moved outside main
/* The following makes no sense:
int ConvertFarenheitToCelsius
{
return Celsius;
}
*/
system("PAUSE "); // don't use this see http://www.cplusplus.com/forum/articles/7312/return 0;
}
int Celsius(int i)
{
// Farenheit = (1.8*i)+32; wrong, Farenheit is a function
return (1.8*i)+32; // this is how you should do it
}
int Farenheit(int i)
{
// Celsius(i) = ( Farenheit-32)/1.8; Nope
return (i-32)/1.8; // same as function Celsius
}