From 0d0ee3d61fa7e1d5d046eaf0d7bc3176676264d4 Mon Sep 17 00:00:00 2001
From: antux18 <antux18@gmail.com>
Date: Mon, 15 Apr 2024 13:10:52 +0200
Subject: [PATCH] Corrections t2.

---
 ex2/.gitignore | 6 ++++++
 ex2/T2.c       | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 ex2/.gitignore

diff --git a/ex2/.gitignore b/ex2/.gitignore
new file mode 100644
index 0000000..981c430
--- /dev/null
+++ b/ex2/.gitignore
@@ -0,0 +1,6 @@
+t1
+t2
+t3
+t4
+t5
+tmp
\ No newline at end of file
diff --git a/ex2/T2.c b/ex2/T2.c
index 87df4a1..af8ad7e 100644
--- a/ex2/T2.c
+++ b/ex2/T2.c
@@ -5,7 +5,7 @@
 
 #define SIZE 10000
 
-int meanval = 0;
+float meanval = 0;
 int medianval = 0;
 
 void swap(int *xp, int *yp);
@@ -48,7 +48,7 @@ int main() {
     pthread_join(tid1, NULL);
     pthread_join(tid2, NULL);
 
-    printf("Mean = %d\nMedian = %d\n", meanval, medianval);
+    printf("Mean = %f\nMedian = %d\n", meanval, medianval);
     printf("Mean thread PID: %ld\nMedian thread PID: %ld\n", tid1, tid2);
 
     return 0;
-- 
GitLab