Tuesday, August 16, 2011

Using JOptionPAne Converter for Decimal To Octal Decimal


import javax.swing.JOptionPane;
 import java.io.*;
 import java.lang.*;
public class DecimalToOctal {
    public static void main(String[] args) {
    String deci;
  deci = JOptionPane.showInputDialog(null, "Enter the decimal number:");
     int w = Integer.parseInt(deci);
  String str = Integer.toString(w,8);
  JOptionPane.showMessageDialog(null, "octal:=" + str,"result", JOptionPane.INFORMATION_MESSAGE);
  System.exit(0);
    }
}

No comments:

Post a Comment