Â
In this, we are going to write a simple program to find Area and Circumference of Circle in Java.
class Circle
{
public static void main(String[] args)
{
float r = 12, a, pie = 3.142f, c;
a = pie * r * r;
c = 2 * pie * r;
System.out.println("Area = " + a);
System.out.println("Circumference = " + c);
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP