Double type assignment and math calculation - C++ Data Type

C++ examples for Data Type:double

Description

Double type assignment and math calculation

Demo Code

#include <iostream>
using namespace std;
int main()/*  w w  w .  ja v  a 2  s  .co  m*/
{
   double num1, num2, product;
   num1 = 30.0;
   num2 = 0.05;
   product = num1 * num2;
   cout << "30.0 times 0.05 is " << product << endl;
   return 0;
}

Result


Related Tutorials