Code::Blocks Forums

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

Poll
Question: hi, there is something wrong with my codeblocks using a formula. i don'r really know what happen..
Option 1: 2 votes: 0
Option 2: 1 votes: 1
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 !