I write this code
cout << "Enter one integer and one real number: ";
cin >> IntegerVar >> RealVar;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(3);
cout << "The real is: " << RealVar << endl
<< "The integer is: " << IntegerVar << endl;
but I want the output be like this
The real is :-----12.333
The integer is :------12
I mean I want the out put with dashes or line and I m allowed to use just #include<iostream> only.
If you want hyphens in your input, you'll have to extract your input as a string then parse the input accordingly. For such a case, it's best to use std::string[1] as is provides the functionality to parse the string it contains.
Usually you would use stream manipulators (<iomanip>) for this, but if you're not allowed to, you're pretty much stuck with doing it yourself like Framework said.
I am pretty sure that "parsing" a string doesn't make very much sense though - what you mean is formatting. And the string class does not provide any high level formatting methods.