Saturday, August 20, 2011

Float Point Arithmetic in Java

//Float Point Arithmetic in Java
class FloatPointArithmetic
{
    public static void main(String arg[])
      {
           float a=20.5f, b=6.4f;
           System.out.println(" a= "+a);
           System.out.println(" b= "+b);
           System.out.println(" a+b= "+(a+b));
           System.out.println(" a-b= "+(a-b));
           System.out.println(" a*b= "+(a*b));
           System.out.println(" a/b= "+(a/b));
           System.out.println(" a%b= "+(a%b));
      }
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More