1

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

somethingSomething
  • 830
  • 7
  • 20
  • 43

1 Answers1

2

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

Klas Lindbäck
  • 33,105
  • 5
  • 57
  • 82
  • Thank you, that must be it, I used the wrong project template. I don't know how to check this, but I pasted the code in the right template and there was no error. – somethingSomething Oct 10 '13 at 13:42