Gabri_RDiaz

Java - Negativo/Positivo

Mar 25th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main{
  3.    public static void main(String[] args){
  4.       int num;
  5.       Scanner reader = new Scanner(System.in);
  6.       System.out.print("Escribe una cifra ");
  7.       num= reader.nextInt();
  8.      
  9.       if( num < 0)
  10.          System.out.println("El valor es negativo");
  11.          else
  12.             System.out.println("El valor es positivo");
  13.             }
  14.             }
Advertisement
Add Comment
Please, Sign In to add comment