please find this error.
if it's helpful I will mark as brainliest.
do not spam
Attachments:
Answers
Answered by
1
Error:
Compilation failed due to following error(s).Main.java:13: error: incompatible types: possible lossy conversion from double to float
float avg= 0.0;
Explanations:
A double is a floating point number with double precision, a float is a floating point number with single precision. If you just write 0.0 then it is interpreted as a double. To use the float type you have to write it as 0.0f
Answer:
Use
double avg = 0.0;
Or,
float avg = 0.0f;
avg = sum/3.0f;
Similar questions
Science,
4 months ago
Hindi,
4 months ago
Social Sciences,
9 months ago
Biology,
9 months ago
English,
1 year ago