Reputation: 61
Hi i'm getting an error of:
depthTemperature.c: In function 'main':
depthTemperature.c:29: error: expected declaration or statement at end of input
depthTemperature.c:29: error: expected declaration or statement at end of input
when i try to compile and i'm not sure why, everything seems to be kosher to me, of course there must be something im doing wrong. thank you in advance for your help.
#include <stdio.h>
void celsius_at_depth(double depth);
void fahrenheit(double celsius);
int
main(void)
{
double depth;
printf("Please input your depth to the nearest whole foot (eg. 100)> ");
scanf("%lf", &depth);
celsius_at_depth(depth);
return 0;
{
void celsius_at_depth(double depth)
{
double celsius;
celsius=10*depth+20;
printf("The temperature in celsius is: %f", celsius);
fahrenheit(celsius);
}
void farenheit(double celsius)
{
double farenheit;
farenheit=1.8*celsius+32;
printf("The temperature in farenheit is: %f", farenheit);
}
Upvotes: 1
Views: 15316