Java program to find area to circle and rectangle

Utsav Verma / / 0
Area of a circle and Area of rectangle can simply be evaluated using following formula.
Area = pi * r2
where r is radius of circle 
Area = l*b
where l is length and b is breadth.

File name - Area.java

class Area
{
public static void main(String args[])
{
int Circle_area, Rect_area, l, b, r;
l=10;
b=5;
r=13;

Circle_area=2*r*r;
Rect_area=l*b;

System.out.println("Area of Circle is "+Circle_area);
System.out.println("Area of Rectangle is "+Rect_area);
}
}



Output-


Area of Circle is 338
Area of Rectangle is 50

Utsav Verma


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut odio. Nam sed est. Nam a risus et est iaculis adipiscing. Vestibulum ante ipsum faucibus luctus et ultrices.
Follow me @Bloggertheme9

0 comments:

About Me

My photo
I work as an Analyst in HCL Technologies. Android App Development is my hobby. As a passionate technology lover, you need to keep yourself updated with trending technologies. The best way to learn and stay up to date is simply to do something creative. I’ve a number of small personal app projects and each one have been rewarding and useful in one way or the other.