58.1k views
3 votes
What is the output of doublec= 12.0 / 5 Systemoutprintln (c)

User Shinto C V
by
8.4k points

1 Answer

4 votes

Answer:

The code will produce:-

2.4

Step-by-step explanation:

In this code the result of the arithmetic operation is stored in the variable c.On evaluating the expression it divides 12.0 by 5 which results in 2.4 and it is stored in float variable c.Then it is printed on the screen using print statement.Since the c is double variable so the result will be a decimal number.

Hence the answer is 4.

User TrentWoodbury
by
8.3k points

Related questions

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.