Advertisement
dantepw

Exibir números quebrados

May 4th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1.  
  2.  
  3. package programasAleatorios;
  4.  
  5. import javax.swing.JOptionPane;
  6.  
  7.  
  8. public class exibirNumeros {
  9.    
  10.     public static void main (String[] args){
  11.        
  12.         double a;
  13.        
  14.         a = Double.parseDouble(JOptionPane.showInputDialog(null, "digite um número: "));
  15.        
  16.         double b = Math.round(a);
  17.        
  18.         if(a % b == 0) System.out.print("Seu número sem o \"ponto zero\": " + Math.round(a));
  19.        
  20.         else System.out.print("Seu número quebrado: " + a);
  21.        
  22.     }
  23.    
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement