Write a program that reads a number (n) and prints a message
based on its value as given below:
Value of n
n is greater than zero
n is equal to zero
n is less than zero
Message to print
It is a negative number
It is equal to zero
It is a positive number
Answers
Answered by
4
Answer:
n= int(input("enter the number")
if n>0:
print("it is a positive number")
if n<0:
print("it is a negative number")
else:
print("it is equal")
Answered by
3
#include<studio.h>
#include<conio.h>
void main( )
{
int n;
printf ("Enter the number")
if n>0
printf ("It is a positive number")
if n<0
printf ("It is a negative number")
else:
printf ("It is equal")
}
Similar questions