+ 3
How does one declare constant variables like 3.142,for PI?
9 Respuestas
0
static final double PI = 3.141; Or you could just use Math.PI if you want greater precision.
0
define("PI",3.1428); in php
0
there are many constants that are predefined in Java.
0
define("PI",3.1428); in php anyone please help
0
How to write a java statement to declare pi as a constant (pi=3.142).
0
Create a float variable with a variable name of pie and with a value of 3.1416
- 1
What would be the purpose of using PI in a program?
- 1
constant variables can be declared by using constant keyword.
for eg. constant double pi = 3.14
or constant variables can be declared by using Macro.
- 1
If you want just declare constant variable you just wrote .. final float pi = 3.142f; Remember after declare float value is followed by f... examples 2.3 f