Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab1_37

Snippet info

Language

Cpp

Visibility

public

Author

matho.camara

Created

2018-10-13T15:30:11Z

Updated

2018-10-24T08:22:35Z

#include <iostream>
#include <math.h>
using namespace std;

//вариант 37
int main() {
double g,m1,m2,r,result;
  //collecting data
  cout<<"Input G value:"<<endl;
  cin>>g;

  cout<<"Input Mass1 and Mass2 values"<<endl;
  cin>>m1>>m2;

  cout<<"Input R value :";
  cin>>r;

  //controling the data
  if(r>0)
  {
	  //computing the result
	  result=(g*m1*m2)/pow(r,2);

	  cout<<"The result is :"<<result<<endl;
  
  }else
	  cout<<"Error, input a correct R value"<<endl;
    return 0;
}
INFO