Skip to content

Commit 8f7c316

Browse files
committed
area of circle fixed
1 parent 4027d1b commit 8f7c316

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/aakriti/AreaOfCircle.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
package aakriti;
2-
2+
import java.util.Scanner;
33
public class AreaOfCircle {
4-
double r=5;
5-
double pie=3.5;
6-
double area=pie*r*r;
4+
public static void main(String[] args) {
5+
6+
double pi=3.14;
7+
Scanner scanner=new Scanner(System.in);
8+
System.out.println("Input radius of circle");
9+
double r= scanner.nextDouble();
10+
double area=pi*r*r;
11+
System.out.println("The area of circle is: "+area);
12+
}
13+
714

815

916

0 commit comments

Comments
 (0)