int result=360/100;
System.out.println(result);// print 3 because result is an int
since cldc 1.1 you can do
float result=360F / 100F;
System.out.println(result); // print 3.6 because result is a float
> well I didnt used int result=360/100 but
>
> double result=360/100 and was getting 3
yes, you are using int because '360/100' are int primitive values
System.out.println(360/100); // output 3 because 360 and 100 are int primitive
System.out.println(360D/100); // output 3.6 because one of the numbers is a double
System.out.println(360/100D); // // same as above !
> I solved this on this way:
>
> double result=(double)360/100.
your cast is not necessary. see the code above!
> Thanks a lot.
you're welcome
and it wasn't so terrible :-)