package com.company;
import java.util.Scanner;
public class Program17 {
public static void main(String[] args) {
Scanner put= new Scanner(System.in);
System.out.println("please enter a number:");
int num=put.nextInt();
if(num>0)
{
System.out.println("you enter a positive number");
}
else
{
System.out.println("you enter a negative number");
}
}
}
Hi Friends ! You are on HR Developers website. Here you can find the codes of different languages like c ,c++ , java, pyton and many other languages.
Wednesday, June 16, 2021
Java program to get a number from the user and print whether it is positive or negative (Java) (180)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment