Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Sign{
  3. public static void main(String []args){
  4. Scanner sc = new Scanner(System.in);
  5. System.out.println("Enter a number : ");
  6. int num = sc.nextInt();
  7. Sign temp = new Sign();
  8. System.out.println("Number is "+ temp.signer(num));
  9. }
  10. public String signer(int x){
  11. if(x==0){
  12. return("zero");
  13. }else if(x<0){
  14. return("negative");
  15. }else{
  16. return("positive");
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement