How to input (read) double in C++

1 Answer

0 votes
#include <iostream>

using std::cout;
using std::cin;
using std::endl;

int main()
{
	double d;

	cout << "Enter double value: ";
	cin >> d;
	cout << d << endl;

	return 0;
}

/*
run:

Enter double value: 534.786
534.786

*/

 



answered Apr 5, 2018 by avibootz

Related questions

...