By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
 432,109 Members | 1,007 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,109 IT Pros & Developers. It's quick & easy.

Problems compiling this program

 P: n/a Expand|Select|Wrap|Line Numbers #include #include #include #include {      double compute(double ws)      double sqrt(double r)      double main()      {         double mf,v[2],a[2],q,h[2],sv[2],z[2],r,ans2,c,ws;         double g = 9.8;           cout<<"Device: Centrifugal compressor ";         cout<<"Mass flow rate mf (Kg/min) = ";         cin>>mf;                 mf = mf/60;           cout<<"Conditions at inlet: ";         cout<<"v1 (m/s) = ";         cin>>v[0];         cout<<"h1 (KJ/Kg) = ";         cin>>h[0];         cout<<"Specific volume (cubic meter/Kg) = ";         cin>>sv[0];         cout<<"Height of inlet above the ground z1 = ";         cin>>z[0];         cout<<"Condition at exit: ";         cout<<"v2 (m/s) = ";         cin>>v[1];         cout<<"h2 (KJ/Kg) = ";         cout<<"Specific volume (cubic meter/Kg) = ";         cin>>sv[1];         cout<<"Height of outlet above the ground z2 = ";         cin>>z[1];         cout<<"Heat loss to cooling water q (KJ/min) = ";         cin>>q;         cout<<"From SFEE ";             double compute()          {          ws = -1*(mf((h[1]-h[0])+1/2(v[1]*v[1]-v[0]*v[0]+g(z[1]-z[0]))+q);          if (z[0]=z[1])          {                 g(z[1]-z[0]) = 0;          }            cout<<"Thus the power of motor required to drive the compressor is = "<
Share this Question
2 Replies

 Expert Mod 5K+ P: 8,916 You will need to do more than just post your code you will need to describe the problems you're having as well as post the text of any compiler errors you are getting. However for starters The braces at lines 5 and 73 are just wrong main returns int not double You can not define functions inside other functions as you have done at line 41 You shouldn't declare sqrt at line 7, it is declared in math.h which you have included. Oct 2 '10 #2

 Expert 100+ P: 2,398 It is best if you can cut-and-paste your compiler errors into your post. These compiler error messages carry a lot of information. Oct 3 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.