Question: Rewrite the following so that it doesnt use using declarations or using directives: #include using namespace std; int main() { double x; cout < <
Rewrite the following so that it doesn’t use using declarations or using directives:
#include
using namespace std;
int main()
{
double x;
cout << "Enter value: ";
while (! (cin >> x) )
{
cout << "Bad input. Please enter a number: ";
cin.clear();
while (cin.get() != '\n')
continue;
}
cout << "Value = " << x << endl;
return 0;
}
Step by Step Solution
3.53 Rating (153 Votes )
There are 3 Steps involved in it
include int main double x stdcout Ente... View full answer
Get step-by-step solutions from verified subject matter experts
