From 086d3eb16e72c5f733cea9092560fa0117970353 Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Fri, 18 Mar 2022 12:15:53 +0100 Subject: [PATCH] DSA --- du3/program.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/du3/program.c b/du3/program.c index d4a3196..6589e2c 100644 --- a/du3/program.c +++ b/du3/program.c @@ -3,7 +3,6 @@ int main(){ float vxod[999]; int i = 0; - int a = 1; float result = 0; while(1){ float value = 0; @@ -17,8 +16,7 @@ int main(){ printf("Nepodarilo sa nacitat zaklad x\n"); break; }else{ - for(a = 1; a < i; a++) - printf("%.2f\n", vxod[a]); + for(int a = 1; a < i; a++) result = vxod[0] * result + vxod[a]; printf("Vysledok je: %.2f\n", result); break;