C++ examples for Data Type:double
Read double type value from commandline using cin
#include <iostream> using namespace std; int main()//from w w w. j a v a 2s .c om { double num1, num2, product; cout << "Please type in a number: "; cin >> num1; cout << "Please type in another number: "; cin >> num2; product = num1 * num2; cout << num1 << " times " << num2 << " is " << product << endl; return 0; }