Write a program to compute the area of the circle.
0
/* Write a program to compute the area of the circle. */
class Area{
public static void main(String args[]){
double pi,r,a;
pi=3.1416;
r=10.8;
a=pi*r*r;
System.out.println("Area of circle:"+a);
}
}
/*
Output:
E:>javac Area.java
E:>java Area
Area of circle:366.436224
*/
class Area{
public static void main(String args[]){
double pi,r,a;
pi=3.1416;
r=10.8;
a=pi*r*r;
System.out.println("Area of circle:"+a);
}
}
/*
Output:
E:>javac Area.java
E:>java Area
Area of circle:366.436224
*/
0 comments: