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