0

Getting error : not sure why
error C2660: 'convert_to_Fahrenheit' : function does not take 1 arguments

#include <iostream>
#include <iomanip>

using namespace std;

int convert_to_Fahrenheit();

int main()
{
    int celcius = 0;
    int fahrenheit = 0;

    cout << "Enter a temperature in Celcius and I will convert to Fahrenheit: " << endl;
    cin >> celcius;
    convert_to_Fahrenheit(celcius);
    cout << celcius <<  " is equal to " <<    fahrenheit << " degrees." << endl; 

    return 0;
}

int convert_to_Fahrenheit(int celcius)
{
    int convert = 0;
    //°C  x  9/5 + 32 = °F
    convert = ((celcius * 9) / 5) + 32;

    return convert;
}
1
Contributor
1
Reply
3
Views
6 Years
Discussion Span
Last Post by rkstengel
0

Found it. The prototype() must have a declared argument.

int convert_to_Fahrenheit(int celcius); //prototype
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.