문제

I'm new to programming. I'm using Pelles C ide to compile C and it was working yesterday but now there is this error.

enter image description here

Here is the code from the project:

#include <stdio.h>

int main(void)
{
double operand1;
double result;
char operator;
double operand2;

printf("This is a calculator");
printf("Type a simple expression...");
scanf("%lf %s %lf", &operand1, &operator, &operand2);

if(operator == '+')
{
    result = operand1 + operand2;
}
else if (operator == '-')
{
    result = operand1 + operand2;
}
else if (operator == '*')
{
    result = operand1 * operand2;
}
else if (operator == '/')
{
    result = operand1 / operand2;
}
else
{
    printf("Wrong input. Exiting.");
    return 1;
}

printf("The answer is: %lf ", result);

return 0;

}

What is the cause for this error?

There is also this, I don't remember this being there before enter image description here

도움이 되었습니까?

해결책

I've never used that particular IDE, but it looks like your project type has inadvertantly changed from console to Windows application.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top