Skip to content

Instantly share code, notes, and snippets.

@mariiaKolokolova
Created May 22, 2020 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariiaKolokolova/5ecd11a8f4d155ba81365714748dc43e to your computer and use it in GitHub Desktop.
Save mariiaKolokolova/5ecd11a8f4d155ba81365714748dc43e to your computer and use it in GitHub Desktop.
package maricka.kolokolova;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 10;
for (int i = 1; i <= a; i++) {
printPi(i + 1);
}
}
public static void printPi(int n) {
System.out.println(String.format("Pi: %." + n + "f", Math.PI));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment