diff --git a/du4/program b/du4/program index 18bfcf1..bbcaec8 100755 Binary files a/du4/program and b/du4/program differ diff --git a/du4/program.c b/du4/program.c index 99281b6..ecaa58b 100644 --- a/du4/program.c +++ b/du4/program.c @@ -105,6 +105,9 @@ int main(){ msum=values[2]; if(operation=='+'){ rsum=values[0]+values[1]; + char rmsum[50]; + sprintf(rmsum, "%.2f", msum); + msum = atof(rmsum); if(msum==rsum){ printf("OK\n"); } @@ -115,6 +118,9 @@ int main(){ } else if(operation=='-'){ rsum=values[0]-values[1]; + char rmsum[50]; + sprintf(rmsum, "%.2f", msum); + msum = atof(rmsum); if(msum==rsum){ printf("OK\n"); } @@ -125,6 +131,9 @@ int main(){ } else if(operation=='*'){ rsum=values[0]*values[1]; + char rmsum[50]; + sprintf(rmsum, "%.2f", msum); + msum = atof(rmsum); if(msum==rsum){ printf("OK\n"); } @@ -135,6 +144,9 @@ int main(){ } else if(operation=='/'){ rsum=values[0]/values[1]; + char rmsum[50]; + sprintf(rmsum, "%.2f", msum); + msum = atof(rmsum); if(msum==rsum){ printf("OK\n"); }