Computer Science, asked by Phillipe, 8 months ago

Write a program to display hotel bill. Use manipulators in C++?

Answers

Answered by Sanjanahere
2

Answer:

Manipulators in C++ with Examples

Manipulators are helping functions that can modify the input/output stream. It does not mean that we change the value of a variable, it only modifies the I/O stream using insertion and extraction operators.

For example, if we want to print the hexadecimal value of 100 then we can print it as:

Types of Manipulators

There are various types of manipulators:

Manipulators without arguments: The most important manipulators defined by the IOStream library are provided below.

endl: It is defined in ostream. It is used to enter a new line and after entering a new line it flushes (i.e. it forces all the output written on the screen or in the file) the output stream.

ws: It is defined in istream and is used to ignore the whitespaces in the string sequence.

ends: It is also defined in ostream and it inserts a null character into the output stream. It typically works with std::ostrstream, when the associated output buffer needs to be null-terminated to be processed as a C string.

flush: It is also defined in ostream and it flushes the output stream, i.e. it forces all the output written on the screen or in the file. Without flush, the output would be the same, but may not appear in real-time.

Answered by hanishababy
0

Answer:

here is your answer friend

hope it is help

mark me as brainlist friend

Attachments:
Similar questions