Thread: Try again

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    9

    Question Try again

    VisualC++6.0
    This is for a Calculate the area of a circle given the diameter.

    Ok this is what I have so far;
    #include<math.h>
    voidmain(void)
    {
    pie,diameter,areais,sqrt(2);

    cout<<"Enter Pie ";
    cin>>Pie;
    cout<< "Enter Diameter ";
    cin>>diameter;
    cout<< "Enter Area Is ";
    cin>>areais;
    cout<< "EnterSquare(2) ";
    cin>>sqrt(2)

    pie *4sqrt(2)/4


    Do I have everything so far.

  2. #2
    Registered User jasrajva's Avatar
    Join Date
    Oct 2001
    Posts
    99
    what are you tring to do here???

    the area of a circle given its diameter is (PI*(D^2))/4

    const float PI = 3.14159;

    float dia, area;

    int main(void)

    {

    cin >> dia;

    area = PI* dia*dia/4;

    cout << area;

    return 0;

    }
    jv

Popular pages Recent additions subscribe to a feed