Computer Science, asked by yajat3217, 6 days ago

WAP to find the number entered by user is positive or negative.​

Answers

Answered by snehakashelkar068
0

Answer:

Write a C program to check whether a given numb

Explanation:

please mark me in brainlist

Answered by samarthkrv
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