From c4b75b1b9d6d9a0667a9edadc0f226a88b37d981 Mon Sep 17 00:00:00 2001 From: Hendrik Sitzmann Date: Thu, 8 Feb 2024 21:35:26 +0100 Subject: [PATCH] refactoring: function got smaller --- src/gaussscheSummenformel/gaussscheSummenformel.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gaussscheSummenformel/gaussscheSummenformel.c b/src/gaussscheSummenformel/gaussscheSummenformel.c index 986ae81..d4b9912 100644 --- a/src/gaussscheSummenformel/gaussscheSummenformel.c +++ b/src/gaussscheSummenformel/gaussscheSummenformel.c @@ -2,9 +2,5 @@ int gaussscheSummenformel(int n) { - int result = n * (n + 1); - - result = result / 2; - - return result; + return (n * (n + 1)) / 2; } \ No newline at end of file