C 温度读数

C 温度读数,c,C,HELPPPPPP……这是我的代码,用于用户输入的温度读数,但我真的不确定我的代码出了什么问题。当我编译它时,它会说“在'else'之前需要表达式”。我需要帮助,提前谢谢 #include <stdio.h> main() { double lowest = 38; double temp; char bpower; printf("Enter temperature(C):"); scanf("%lf", &temp);

HELPPPPPP……这是我的代码,用于用户输入的温度读数,但我真的不确定我的代码出了什么问题。当我编译它时,它会说“在'else'之前需要表达式”。我需要帮助,提前谢谢

#include <stdio.h>

   main()
   {
   double lowest = 38;
   double temp;
   char bpower;

   printf("Enter temperature(C):");
   scanf("%lf", &temp);

   if(temp<lowest)
   {

     lowest = temp;

   }

     printf("Backup power on? (Y/N):");
     fflush(stdin);
     scanf("%c", &bpower);

    if(temp < 50);
    {

    printf("Normal mode of operation\n");
    printf("Continue to read the next temperature\n");

    }

    else

    {

       if(temp < 80)

       {
        printf("Turn on circulating fan\n");
        printf("Continue to read the next temperature\n");

       }


       else

       {
         if(bpower == 'N')   



        {
        printf("Turn off equipment\n");
        printf("Lowest temperature is %.2f", lowest);

        }

        else

        {  

         printf("Continue to read the next temperature\n");

         }

      }



 }
}
#包括
main()
{
双倍最低=38;
双温;
炭粉;
printf(“输入温度(C):”;
扫描频率(“%lf”、&temp);

if(temp您的
if
语句中有一个分号。请更改此项:

if(temp < 50);
{

printf("Normal mode of operation\n");
printf("Continue to read the next temperature\n");

}
if(温度<50);
{
printf(“正常操作模式”);
printf(“继续读取下一个温度\n”);
}
为此:

if(temp < 50)
{

printf("Normal mode of operation\n");
printf("Continue to read the next temperature\n");

}
if(温度<50)
{
printf(“正常操作模式”);
printf(“继续读取下一个温度\n”);
}

fflush(stdin);
-这有未定义的行为
if(temp<50)
--仔细看这里。可以整理代码的缩进-你需要这么多空白行吗缩进老兄…很重要的是,如果你逐行逐行地看一遍,这段代码的行为会更加明显。你学习软件开发的下一步,已经过期的一步,就到了f找出如何使用调试器。在你拥有至少最低限度的调试技能之前,不要再编写任何代码。