The problem is the same as this:
A program returns different results in two IDE
I have this same issue, but in VSCode, and in C language. How do I set it for 64-bit compilation?
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const* argv[])
{
char string[20];
printf("Informe o nome: ");
scanf("%[^\n]%*c", &string);
double salario = 0;
printf("Informe o salario: ");
scanf("%lf", &salario);
double salarioCopy = salario;
if (salario > 4087.65) {
salario = salario * 0.725;
}
else if (salario >= 3271.39) {
salario = salario * 0.775;
}
else if (salario >= 2453.51) {
salario = salario * 0.85;
}
else if (salario >= 1637.12) {
salario = salario * 0.925;
}
else {
}
printf("\n%s ganha R$ %.2f, que apos abatido o IR, ficam R$ %.2f\n", string, salarioCopy, salario);
system("PAUSE");
return 0;
}
f I input 10000
, the result in VSCode is: 9250
, while in a online IDE i get 7250
.
Can anybody help?