Ask Question
27 January, 13:07

Create a float variable named diameter. This variable will hold the diameter of a circle. d. Create a float variable named PI.

+2
Answers (1)
  1. 27 January, 16:06
    0
    float diameter=2*r; / /hold the diameter of a circle

    float PI; / / float variable named PI.

    Explanation:

    Here we have declared two variable i. e diameter and PI of type float. The variable diameter will hold the diameter of a circle i. e 2*r where r is the radius of a circle.

    Following are the program in c++

    #include / / header file

    using namespace std; / / namespace

    int main () / / main function

    {

    float r=9.2; / / variable declaration

    float diameter=2*r; / /hold the diameter of a circle

    float PI=3.14; / / float variable named PI hold 3.14

    cout<<"diameter IS : "<
    return 0;

    }

    Output:

    diameter IS : 18.4

    PI IS : 3.14
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Create a float variable named diameter. This variable will hold the diameter of a circle. d. Create a float variable named PI. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers