Computer Science, asked by muktadirj729, 9 months ago

Write a c code which determines whether the number is positive or negative using a function.

Answers

Answered by avinashkumar288
1

Answer:

#include <stdio.h>

int main()

{

int num;

/* Input number from user */

printf("Enter any number: ");

scanf("%d", &num);

if(num > 0)

{

printf("Number is POSITIVE");

}

if(num < 0)

{

printf("Number is NEGATIVE");

}

if(num == 0)

{

printf("Number is ZERO");

}

return 0;

}

here is the code for it please follow me I answer coding related questions

i

Answered by Anonymous
3

Answer:

Input a number from user in some variable say num . Check if(num < 0) , then number is negative. Check if(num > 0) , then number is positive. Check if(num == 0) , then number is zero.

hope it helps you mate.

please thank and mark my answer as brainliest.

@ ANUSHA

Similar questions