In this program user inputs the mass of two bodies and the distance between them and calculate and output the Force of attraction between two masses according to Newton's law of gravitation.
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float f,m1,m2,r;
cout<<"Enter the value of two masses in Kg : ";
cin>>m1>>m2;
cout<<"Enter the distance between two masses in meters : ";
cin>>r;
f=(6.67*pow(10.0,-11.0)*m1*m2)/(r*r);
cout<<"The force of attraction between two masses = "<<f<<" Newton ";
getch();
}
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float f,m1,m2,r;
cout<<"Enter the value of two masses in Kg : ";
cin>>m1>>m2;
cout<<"Enter the distance between two masses in meters : ";
cin>>r;
f=(6.67*pow(10.0,-11.0)*m1*m2)/(r*r);
cout<<"The force of attraction between two masses = "<<f<<" Newton ";
getch();
}
f=(6.67*pow(10.0,-11.0)*m1*m2)/(r*r);
ReplyDeleteI don't understand this part can u plz explain....??
f=(6.67*pow(10.0,-11.0)*m1*m2)/(r*r);
ReplyDeleteI don't understand this part p/z explain??
"f=(6.67*pow(10.0,-11.0)*m1*m2)/(r*r)"
ReplyDeletecan you explain this above step ??
Reading something so delightful has a recuperating power for the spirit.
ReplyDeleteCitywide Law Group
Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks Tulsa Private Investigations
ReplyDeleteOn this page, you'll see my profile, please read this information. https://www.paulmankin.com/
ReplyDelete