Ask Question

Which of the following code displays the area of a circle if the radius is positive. a. if (radius! = 0) System. out. println (radius * radius * 3.14159); b. if (radius > = 0) System. out. println (radius * radius * 3.14159); c. if (radius 0) System. out. println (radius * radius * 3.14159);

+4
Answers (1)
  1. 22 July, 08:48
    0
    d. if (radius > 0) System. out. println (radius * radius * 3.14159);

    Explanation:

    The positive values are those values that are greater than 0 (zero).0 is considered to be nonnegative number it is neither positive nor negative and for a zero radius the area will be 0. As we know the are of the circle is π*radius*radius, and π is 3.14159. So the correct answer matching to this condition is option d.

    Which checks if the radius is greater than 0 then find the radius and print it.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following code displays the area of a circle if the radius is positive. a. if (radius! = 0) System. out. println (radius * ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers