ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ code?
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
    stringstream mys(ios :: in | ios :: out);
    std :: string dat("The double value is : 74.79 .");
    mys.str(dat);
    mys.seekg(-7, ios :: end);
    double val;
    mys >> val;
    val = val*val;
    mys.seekp(-7,ios::end);
    mys << val;
    std :: string new_val = mys.str();
    cout << new_val;
    return 0;
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.