hey there,

following is the C++ code for it. but there is one ambiguity in it. you have written the formula for calculating the Celcius as under:

Celcius = 10 (depth) + 20 (

**Celsius temperature at depth in Km)**
But i dont get where will this "Celcius Tempertaure at Depth" Come from?

will u take it from the user as well?because i think ur program is only taking depth as an input from the user!

just clear this and i will complete the CelciusAtDepth Function for u. For now here goes ur remaining code!

#include<stdio.h>

#include<math.h>

#include<conio.h>

using namespace std;

float CelciusAtDepth(float);

float Fahrenheit(float);

void main()

{

float depth,Celcius,Fahren;

cout<<"Enter the depth"<<endl;

cin>>depth;

Celcius=CelciusAtDepth(depth);

cout<<"The Temperature in Celcius is "<<Celcius<<endl;

Fahren=Fahrenheit(Celcius);

cout<<"The Temperature in Fahrenheit is "<<Fahren<<endl;

return 0;

}

float CelciusAtDepth(float Cel)

{

// To be completed...

}

float Fahrenheit(float C)

{

float x;

x=1.8*C;

x=x+32;

return x;

}

I am supposed to write a program to take a depth (in kilometers) inside the earth as input data; compute and display the temperature at this depth in degree Celsius and degree Fahrenheit. The relevant formula are

- Celcius = 10 (depth) + 20 (Celsius temperature at depth in Km)

- Fahrenheit = 1.8 (Celsius) + 32

Include two functions in your programs. Function CelsiusAtDepth should compute and return the Celsius temperature at a depth measured in Km. Function Fahrenheit should convert a Celsius temperature to Fahrenheit