Hi i am a beginner, and I have this homework for my beginning C class. I keep getting errors for the program I wrote particularly with my function. Here's my program:
#include <stdio.h>
//Function Declarations
double obtainTemp (void);
**double convertTemp (double tempF, double tempR, double tempC, double tempK);**
void printResult (double tempF, double tempR, double tempC, double tempK);
int main (void)
{
//Local Declarations
double tempF;
double tempR;
double tempC;
double tempK;
double fahrenheit;
double rankine;
double celsius;
double kelvin;
//Calling the functions
fahrenheit = obtainTemp ();
rankine = convertTemp (tempR);
celsius = convertTemp (tempC);
kelvin = convertTemp (tempK);
//will print it by...
printResult (tempF, tempR, tempC, tempK);
int temp;
printf("Press anything to exit: ");
scanf("%d", &temp);
return 0;
}//main
//============obtainTemp===============
double obtainTemp (void)
{
//Local Declarations
double tempF;
printf("Enter temperature: ");
scanf("%lf", &tempF);
return tempF;
}
//============convertTemp==============
int convertTemp (double tempF, double tempR, double tempC, double tempK);
{
//Statements
tempR = (tempF - 32) + 491.67;
tempC = (tempF - 32) * 100/180;
tempK = tempC + 273.16;
return tempF, tempR, tempC, tempK;
}
//============printResult===============
void printResult (double tempF, double tempR, double tempC, double tempK)
{
//Statements
printf("The temperature is %lf degrees fahrenheit\n", tempF);
printf("The value of %lf in rankine is %lf\n", tempF, tempR);
printf("The value of %lf in celsius is %lf\n", tempF, tempC);
printf("The value of %lf in kelvin is %lf\n", tempF, tempK);
return;
}
This function below has too few arguments, and compiler says i can't use it as a function. why oh why?
double convertTemp (double tempF, double tempR, double tempC, double tempK);
Sorry, I am a beginner...i would really appreciate your help :)