Pi calculation on Java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Pi calculation on Java

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double pi = 3.14; } }

29th Jun 2021, 9:15 PM
Mary
1 Answer
+ 4
Is there a question here? If you want PI in Java use; Math.PI (No import needed)
29th Jun 2021, 9:59 PM
ChaoticDawg
ChaoticDawg - avatar