Rewrite the following so that it doesnt use using declarations or using directives: #include using namespace std;

Question:

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;
}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

C++ Primer Plus

ISBN: 9780321776402

6th Edition

Authors: Stephen Prata

Question Posted: