Code:
//Lab 9 Problem 3 program that allows user find mass of a particle
#include <iostream>
using namespace std;
int main()
{//defining variables
float m, v, count;
char exit_variable;
cout<<"This is a programme to determine the mass of a particle";
v = 0.2;
while (v<=0.9)
{m=1/(sqrt(1-(v*v)));
cout<<" when v is"<<v;
cout<<"\nThe mass of the particle is"<<m;
v=v+.1;
}
cout<<"Press any key to exit";
cin>>exit_variable;
}
Comment