is ds right??..
CODE
#include<math.h>
double grav_force(double m1_par, double m2_par, double d_par);
main()
{
double m1, m2, d, f;
clrscr();
cout<<" mass 1: ";
cin>> m1;
cout<<" mass 2: ";
cin>> m2;
cout<<" distance: ";
cin>> d;
f=grav_force(m1, m2, d);
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(9);
cout<<" Gravitational force: "<<f;
getche();
}
double grav_force(double m1_par, double m2_par, double d_par)
{
double g, f, d2, ans;
g=6.673*pow(10,-8);
ans=g*m1_par*m2_par;
d2=pow(d_par, 2);
f=ans/d2;
return(f);
}
QUOTE(qdoom @ 6 Mar, 2007 - 04:24 AM)

If you want more information about functions (what are they, how do you use them etc.), I suggest you'd check out these links:
http://www.cprogramming.com/tutorial/lesson4.htmlhttp://www.functionx.com/cpp/Lesson05.htmhttp://www.functionx.com/cpp/Lesson06.htmIf you'll still think, that you need help after that - don't hesitate to ask.