C++ double type Calculate speed

Description

C++ double type Calculate speed

#include <iostream>
using namespace std;
int main()//from ww w  .j a v a 2s.c  om
{
   double speed, fe, fr;
   fe = 2e10;
   fr = 2.0000004e10;
   speed = 6.685e8 * (fr - fe) / (fr + fe);
   cout << "The speed is " << speed << " miles/hour " << endl;
   return 0;
}



PreviousNext

Related