Java program to calculate the area of a circle
Code:
import static java.lang.System.out; public class AreaOfCircle { public static void main(String args[]) { float radius=5; double area = (3.14) * radius*radius; // can't use (22/7) bcz it will take int truncated value out.println("The area of the cirle having radius:"+radius+ " is: "+area); } }
Output:
