Try again

This is a discussion on Try again within the C++ Programming forums, part of the General Programming Boards category; VisualC++6.0 This is for a Calculate the area of a circle given the diameter. Ok this is what I have ...

  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;

    }

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21