Basic Java programs for beginners

WalterThor

Recruit Rank 0
Nov 6, 2020
7
0
  • Java Program to find the area of a circle
Java:
public class Main {

    public static void main(String[] args) {
    System.out.println("Enter the radius of the circle to find it's area:");
    Scanner input= new Scanner(System.in);
    int a=input.nextInt();
    float  area= 3.14f* a*a;
    System.out.println ("The area of the given circle is: "+area);
    }
}
 


Topics You Missed

Advertisement

Latest Posts