package circlearea;
/**
*
* @author Almer
*/
public class CircleArea {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
double pi = Math.PI;
for (int r = 1; r <= 5; r++) {
double area = pi * r * r;
System.out.println("Radius: " + r + ", Area: " + area);
}
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter