ошибка: ожидаемое объявление или утверждение в конце ввода - PullRequest
1 голос
/ 21 сентября 2011

Привет, я получаю сообщение об ошибке:

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

, когда я пытаюсь скомпилировать, и я не уверен, почему, мне кажется, все выглядит кошерно, конечно, я должен что-то делатьнеправильно.заранее благодарю за помощь.

#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);
}

1 Ответ

10 голосов
/ 21 сентября 2011

Это не нормально:

int
main(void)
{
    return 0;
{
^ ???
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...