Write a c code which determines whether the number is positive or negative using a function.
Answers
Answered by
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
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
Geography,
4 months ago
English,
4 months ago
Chemistry,
4 months ago
Computer Science,
9 months ago
Math,
9 months ago
Math,
1 year ago
Accountancy,
1 year ago
English,
1 year ago