From aafef3075fc08a870ac898c548f645cfaa903688 Mon Sep 17 00:00:00 2001 From: ak643du Date: Mon, 4 Mar 2024 14:40:37 +0100 Subject: [PATCH] Initialization --- cv3/program.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cv3/program.c b/cv3/program.c index e97d808..0928689 100644 --- a/cv3/program.c +++ b/cv3/program.c @@ -5,10 +5,10 @@ int main() { int coefs[SIZE]; int x = 0; - int input; + int input = 0; int count = 0; - int length; - int result = 0; + int length = 0; + double result = 0.0; while (count < SIZE && scanf("%d", &input) == 1) { coefs[count] = input; @@ -23,7 +23,7 @@ int main() { result = result * x + coefs[i]; } - printf("Result: %d\n", result); + printf("Výsledok je: %.2lf\n", result); return 0; }