Computer Science, asked by siddhanth112006, 10 months ago

Assign the value of pi (3.142) to a variable with the requisite data type
with explination

Answers

Answered by rudrabansal06
0

Answer:

This question already has answers here:

Division of integers in Java [duplicate] (7 answers)

Closed 5 years ago.

I tried of finding answer by googling as well as debugging variable behavior, but unfortunately I dint find any proper answer. Its a question related to Java for instance.

Question : Why 'double' type variable behaves like 'int' type in below condition :

double PI = 22/7 which returns 3

but, double PI = 22.0/7 or 22/7.0 returns 3.14xxxxxxx ?

Help appreciated...

Explanation:

Similar questions