Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: sluft on November 21, 2010, 12:45:55 pm

Title: error with a function
Post by: sluft on November 21, 2010, 12:45:55 pm
int main()
{
    float D,d, l, area, v;
    printf("Escriba el diámetro mayor:");
    scanf("%f",&D);
    printf("Escriba el diametro menor:");
    scanf("%f",&d);
    printf("Escriba la longitud:");
    scanf ("%f", &l);
    if (D<d)
    {
        printf("error");
    }
    else (D>d);
    {
    area = d/2 + 2/3(D/2 - d/2); //HERE IS THE ERROR, and it says "error '3' cannot be used as a function", please i need help//
    }
    v = Pi * l * area;
    printf("El volumen es %f", v);
    return 0;
}
Title: Re: error with a function
Post by: Jenna on November 21, 2010, 12:53:40 pm
Your error is absolutely unrelated to C:B and therefore violating our forum rulse.

Learn the programming basics from a good book or tutorial.

Topic locked !