Advertisement
Guest User

new

a guest
Jul 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std; //yeah you need to add this on Android compilers
  3. #define G pow(6.67408, 0.00000000001) //defining constants
  4. int main ()
  5. //int main()
  6. {
  7.     float m, n, s, f, x; //declare variables
  8.    // collect inputs
  9.      cout << "Enter mass of first object " << m << endl;
  10.     //cin >> m;
  11.     cout << "Enter mass of second object " << n << endl;
  12.     //cin >> n;  
  13.     cout << "Enter the distance between them " << s << endl;
  14.     //cin >> s;
  15.     //process
  16.     x = pow (s, 2);
  17.     f = G * (m*n/x);
  18.     //show output
  19.    cout << "So the gravitational force between the two is = " << f;
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement