#include <stdio.h>
void main()
{
int num;
printf("Enter a number: \n");
scanf("%d", &num);
if (num > 0)
printf("%d is a positive number \n", num);
else if (num < 0)
printf("%d is a negative number \n", num);
else
printf("0 is neither positive nor negative");
}
import java.util.*;
public class Learner{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int num=sc.nextInt();
System.out.println("Enter a number:");
if (num > 0){
System.out.println(" is a positive number"+num);
}
else if (num < 0){
System.out.println(" is a negative number"+num);
}
else{
System.out.println("0 is neither positive nor negative");
}
}
}
OUTPUT 1
Enter a number:
0
0 is neither positive nor negative
OUTPUT 2
Enter a number:
-4
-4 is a negative number
OUTPUT 3
Enter a number:
10
10 is a positive number