I can't figure out how to get rid of this error. The trouble is on line 44. Does anyone have any idea what's wrong? It's probably something simple, but I have no clue what to do.
//This program calculates the area of a ring
#include<iostream.h>
// function declaration.
double circleArea(double)
main() //First error=expected init-declarator before "main" , 2nd error=expected `,' or `;' before "main"
{
double rad1;
double rad2;
double ringArea;
cout<<"Please enter the outer radius value:";
cin>>rad1;
cout<<"Please enter the radius of the inner circle:";
cin>>rad2;
ringArea=circleArea(rad1)-circleArea(rad2);
cout<<"Area of the ring having inner raduis"<<rad2<<"and the outer radius"<<rad1<<"is"<<ringArea;
}
ANY BODY COULD HELP ON THIS I AM USING Dev-C++, two errors are coming by compiler I've written them after main() as comments.
@Muhammad:
-the 1st error can be solved by changing main() into int main()
-the 2nd error can be solved (as devc++ states) by adding a ; after double circleArea(double)
That should solve your problem (:
@Zgalhardo:
Sorry, I can't find the problem (probably because I'm to much of a beginner :P) so sorry for adding a (for you) useless post to this thread :)