//
find 3rd digit to right of a decimal point by Hing Tze
import java.io.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class Application1
{
public Application1()
{
double number = 1192.328984;
int answer;
number = number * 1000;
//shiftpoint 3 places
answer = (int) number % 10;
// convert a double
// variable to int type
//take the remainder
// number/10
JOptionPane.showMessageDialog(null,"The answer
is: " + answer);
}
public static void main(String args[])
{
Application1 app = new
Application1();
System.exit(0);
}
} |