Calculate speed in double type - C++ Data Type

C++ examples for Data Type:double

Description

Calculate speed in double type

Demo Code

#include <iostream>
using namespace std;
int main()// w ww  .  j  a v a2 s .  c o  m
{
   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;
}

Result


Related Tutorials