Program to demonstrate Floating-point arithmetic

/* Program to demonstrate Floating-point arithmetic */

class FloatPoint
{
    public static void main(String args[ ])
    {
        float a=10.5F,b=6.1F;
        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));
      
    }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|