diff --git a/cv3/program.c b/cv3/program.c index 56484d2..f7f52a4 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -13,15 +13,13 @@ int main() { opakovania++; } - float result = pole[1]; + float vysledok = pole[1]; for (int i = 2; i < opakovania; ++i) { - result = result * pole[0] + pole[i]; + vysledok = vysledok * pole[0] + pole[i]; } - result = ((int)(result * 100 + 0.5)) / 100.0; - - printf("Vysledok je: %.2f\n", result); + printf("Vysledok je: %.2f\n", vysledok); return 0; }