+ 4
Program to calculate area and circumference of circle using constructor in java??
2 Réponses
+ 6
Ms. Nothing please show us your code so we can help you or atleast guide you.
The basic formulas were given in the project as
int areaofSq = s * s;
double areaofCr = Math.PI * r * r;
+ 1
import java.util.Scanner; public class CircumfrenceOfCircle { public static void main(String args[]){ iimport java.util.Scanner;
public class CircumfrenceOfCircle {
public static void main(String args[]){
int radius;
double circumference;
Scanner sc = new Scanner(System.in);
System.out.println("Enter the radius of the circle ::");
radius = sc.nextInt();
circumference = Math.PI*2*radius;
System.out.println("Circumference of the circle is ::"+circumference);
}
}nt radius; double circumference; Scanner sc = new Scanner(System.in); System.out.println("Enter the radius of the circle ::"); radius = sc.nextInt(); circumference = Math.PI*2*radius; System.out.println("Circumference of the circle is ::"+circumference); } }