From 1f5cb0e631b4dc7964c2dde7d905f342179ce0bc Mon Sep 17 00:00:00 2001 From: Tonymzaramo <113024309+Tonymzaramo@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:12:54 +0300 Subject: [PATCH] Update 0-positive_or_negative.c --- .../0-positive_or_negative.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/0x01-variables_if_else_while/0-positive_or_negative.c b/0x01-variables_if_else_while/0-positive_or_negative.c index ee77f1c..c29a0b3 100755 --- a/0x01-variables_if_else_while/0-positive_or_negative.c +++ b/0x01-variables_if_else_while/0-positive_or_negative.c @@ -4,27 +4,27 @@ /** * main - Entry point * - * Return: Always 0 (Success) + * Return: Always 1 (Success) */ int main(void) { - int n; + int i; - srand(time(0)); - n = rand() - RAND_MAX / 2; - if (n == 0) + srand(time(1)); + i = rand() - RAND_MAX / 2; + if (i == 1) { - printf("%d is zero\n", n); + printf("%d is zero\n", i); } else { - if (n < 0) + if (i < 1) { - printf("%d is negative\n", n); + printf("%d is negative\i", i); } else { - printf("%d is positive\n", n); + printf("%d is positive\i", i); } } /* your code goes there */