-
What is the output of this program?
#include <iostream>
#include <ios>
#include <istream>
#include <limits>
using namespace std;
template <typename CharT>
void ignore_line ( basic_istream& in )
{
in.ignore ( numeric_limits:: max(), in.widen ( '\n' ) );
}
int main()
{
cout << "First Any Number or String: ";
cin.get();
cout << "Clearing cin Data.\n";
cin.clear();
ignore_line ( cin );
cout << "All done Smoothly.\n";
}
-
- First Any Number or String:
- Clearing cin Data.
- Compilation Error
- Runtime Error
- None of these
Correct Option: E
In this program, We are getting the input and clearing all the values.