WAP to find the number entered by user is positive or negative.
Answers
Answered by
0
Answer:
Write a C program to check whether a given numb
Explanation:
please mark me in brainlist
Answered by
0
Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number:");
int num = sc.nextInt();
if(num < 0){
System.out.println(num + " is a negative number");
}
else{
System.out.println(num + " is a positive number");
}
}
}
Explanation:
Similar questions