cours_progra/q2/algo/tp1/Cercle.java

19 lines
409 B
Java
Raw Permalink Normal View History

2023-03-09 11:38:23 +01:00
public class Cercle {
public static final double PI = 3.14159265;
public static void main(String[] args) {
for (int i = 1; i <= 50; i++) {
System.out.println("pour un cercle de rayon : " + i + " Perimetre:" + perimetre(i)+ " aire:" + aire(i));
}
}
public static double perimetre(double rayon){
return 2*PI*rayon;
}
public static double aire(double rayon){
return PI*rayon*rayon;
}
}