importjava.util.Scanner;classKW{publicstaticvoidmain(Stringargs[]){floatr;Scannersc=newScanner(System.in);System.out.println("———————————————————————————————————————————");System.out.println("Program to calculate the area of circle ");System.out.println("———————————————————————————————————————————");System.out.print("Enter the radius of circle ");r=sc.nextFloat();System.out.println("Area of circle is "+(3.14*r*r));System.out.println("Circumference of circle is "+(2*3.14*r));System.out.println("———————————————————————————————————————————");}}
Output
kodingwindow@kw:~$ javac KW.java kodingwindow@kw:~$ java KW
———————————————————————————————————————————
Program to calculate the area of circle
———————————————————————————————————————————
Enter the radius of circle 10
Area of circle is 314.0
Circumference of circle is 62.800000000000004
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?