|
From: <gi...@li...> - 2002-03-28 17:59:41
|
At 03:26 28/03/02 -0500, Ib...@ao... wrote:
> ...
>hi,
>experts please,i really need ur help on this one,the complier results is that
>i have syntax errors and i have tried everything ,please help.
>omosefe.
the following code works, check it against the lines you posted. If you
have questions, let us know.
#include <iomanip>
// all ANSI C++ programs require a "main" function.
int
main()
{
float number1; // first number
float number2; // second number
std::cout << "Enter 2 floating point numbers" << std::endl;
std::cin >> number1 >> number2; // one instruction reads both
// remember that some settings are active until you change them,
// the precision and the way real numbers are displayed are an
// example.
std::cout << "The floating point numbers are:\n"
<< std::setprecision(2)
<< std::setiosflags(std::ios::fixed | std::ios::showpoint)
<< "number1 is: " << number1 << '\n'
<< "number2 is: " << number2 << '\n';
}
--
gisan
gi...@li...
|