Update 'du4/program.c'

This commit is contained in:
Anzhelika Nikolaieva 2023-03-17 21:42:42 +00:00
parent bfc52924ce
commit 31ca326c6b

View File

@ -47,7 +47,7 @@ int main() {
if (valid) {
// Evaluate expression
float result;
float result = 0;
switch (op) {
case '+':
result = num1 + num2;
@ -64,14 +64,14 @@ int main() {
}
}
expected = round(expected * 100) / 100;
if (fabs(result - expected) < 0.001) {
result = round(result * 100) / 100;
if (num2(result - result) < 0.001) {
printf("OK\n");
} else {
printf("ZLE\n");
}
}
}
return EXIT_SUCCESS;
}