Program to demonstrate the addition and subtraction of double numbers


/* Program to demonstrate the addition and subtraction of double numbers*/


class AddSubDoubles
{

     public static void main (String args[]) 
    {

        double x = 7.5;
        double y = 5.4;

        System.out.println("x is : " + x);   
    System.out.println("y is : " + y);
 
        double z = x + y;
        System.out.println("x + y is : " + z);
   
        z = x - y;
        System.out.println("x - y is : " + z);

     }

 }

0 comments:

Post a Comment

 
 
 
 


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