From 7760084e5ad77548f832964447763fdd4318a0c5 Mon Sep 17 00:00:00 2001 From: ak643du Date: Thu, 25 Apr 2024 20:02:38 +0200 Subject: [PATCH] Initialization --- cv10/program.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cv10/program.c b/cv10/program.c index a434004..0aebb24 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -50,15 +50,16 @@ int main() { // Sort the applications alphabetically qsort(applications, i, sizeof(char *), compare_names); - printf("Prijati studenti:"); - j = 0; - while (j < i) { + printf("Prijati studenti:\n"); + for (j = 0; j < i; j++) { printf("%s\n", applications[j]); - j++; } if (count < i) { printf("Neprijati studenti:\n"); + for (; j < i; j++) { + printf("%s\n", applications[j]); + } } // Free allocated memory @@ -68,4 +69,4 @@ int main() { free(applications); return 0; -} \ No newline at end of file +}