1.

What is the output of this program?
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
stringstream strstream(ios :: in | ios :: out);
std :: string data("The double value is : 12.25 .");
strstream.str(data);
strstream.seekg(-5, ios :: end);
double value;
strstream >> value;
value = value*value;
strstream.seekp(-5,ios::end);
strstream << value;
std :: string new_value = strstream.str();
cout << new_value;
return 0;
}

A. 12.25
B. Compilation Error
C. 120.0625
D. Runtime Error
E. None of these
Answer» D. Runtime Error


Discussion

No Comment Found

Related MCQs