Why does ci1
contain the wrong value
Whats going on when you multiply three int and convert to long?
public class integers{
public static void main(String []args){
int im1 = 12*5280;
long ci1;
long im2 = 12*5280;
long ci2;
ci1 = im1 * im1 * im1;
ci2= im2 * im2* im2;
System.out.println(im1+" "+ci1);
System.out.println(im2 +" "+ci2);
}
}
Output is
63360 1507852288
63360 254358061056000
the second line is the correct answer and 63360 fts easily into an int