Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top