Sunday, May 5, 2013

Write a java program to find the area of the Circle


/* Program to find the Area of the Circle using pi*r*r formula */
import java.lang.*;
import java.io.*;
class Circlearea
{
    public static void main(String args[])
    {
        float pi=3.14159f,area;
        int r=5;
        area=pi*r*r;
        System.out.println("The area of the circle is:"+area);
    }
}

Output:

E:\javamani>java Circlearea
The area of the circle is:78.53975

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More