From e037d3237a99f8beff050b1a80af8f9e81f0d41a Mon Sep 17 00:00:00 2001 From: fdai7968 Date: Mon, 5 Feb 2024 17:03:55 +0000 Subject: [PATCH] refactoring case one or two zeros always return 0 --- src/multiplication/multiplication.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/multiplication/multiplication.c b/src/multiplication/multiplication.c index ca9e804..aee181c 100644 --- a/src/multiplication/multiplication.c +++ b/src/multiplication/multiplication.c @@ -1,3 +1,4 @@ int multiply(int a, int b) { - return a * b; + if (a==0||b==0) return 0; + else return a * b; }