When writing a constant, what is the essence of the double i.e const double pi =3.14 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When writing a constant, what is the essence of the double i.e const double pi =3.14

Constants

15th Mar 2020, 9:18 AM
Chiamaka
5 Answers
+ 2
`double` is the stored value data type, while `const` is a specifier which tells that the value of <pi> should/can not be modified. It is necessary to define a type for constants, as it is with variables.
15th Mar 2020, 9:52 AM
Ipang
+ 2
Thanks guys
15th Mar 2020, 10:06 AM
Chiamaka
+ 1
Double is for the dot 14 try print the value when you put double and without double you will see
15th Mar 2020, 9:24 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 1
So is it double because there are two numbers after the decimal point?
15th Mar 2020, 9:26 AM
Chiamaka
+ 1
Double allow you to use decimal to a certain precision
15th Mar 2020, 9:27 AM
✳AsterisK✳
✳AsterisK✳ - avatar