Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Sign{
- public static void main(String []args){
- Scanner sc = new Scanner(System.in);
- System.out.println("Enter a number : ");
- int num = sc.nextInt();
- Sign temp = new Sign();
- System.out.println("Number is "+ temp.signer(num));
- }
- public String signer(int x){
- if(x==0){
- return("zero");
- }else if(x<0){
- return("negative");
- }else{
- return("positive");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement