diff --git a/du3/program.c b/du3/program.c index 03f511c..f22d8db 100644 --- a/du3/program.c +++ b/du3/program.c @@ -43,9 +43,11 @@ int main(){ num+=p*n; } - float num2=(round(num*100))/100; + num*=100; + num=round(num); + num/=100; - printf("Vysledok je: %.2f\n", num2); + printf("Vysledok je: %.2f\n", num); return EXIT_SUCCESS; }