Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>This function below has too few arguments,</p> </blockquote> <p>You're telling the compiler it takes four arguments here</p> <pre><code>double convertTemp (double tempF, double tempR, double tempC, double tempK); </code></pre> <p>But you're only passing one here.</p> <pre><code>rankine = convertTemp (tempR); celsius = convertTemp (tempC); kelvin = convertTemp (tempK); </code></pre> <p>I suggest you comment out most of your code, and initialize your doubles, like this.</p> <pre><code>#include &lt;stdio.h&gt; //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 = 0.0; double tempR = 0.0; double tempC = 0.0; double tempK = 0.0; // 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", &amp;temp); return 0; }//main //============obtainTemp=============== //double obtainTemp (void) //{ // //Local Declarations // double tempF; // printf("Enter temperature: "); // scanf("%lf", &amp;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 %f degrees fahrenheit\n", tempF); printf("The value of %f in rankine is %f\n", tempF, tempR); printf("The value of %f in celsius is %f\n", tempF, tempC); printf("The value of %f in kelvin is %f\n", tempF, tempK); return; } </code></pre> <p>That should compile with minimal warnings about unused variables. Next, uncomment and correct the simplest thing, then the next simplest thing, and so on. Try to compile without warnings.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload