Program for computing the volume of a sphere

/*  Program for computing the volume of a sphere  */

class P4
{
    public static void main(String args[])
    {
        float r=2, volume, pi =  3.14152F;
       
        volume = (4 * pi * r * r * r) / 3 ;
                System.out.println("Volume : "+volume);
    }
}

0 comments:

Post a Comment

 
 
 
 


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