answersLogoWhite

0

(don't forget to include) #include <iomanip>

cout << setfill('*') < <setw(35) << '*' <<endl;

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

What is a user defined manipulator in c plus plus?

A user-defined manipulator is a function which can be passed as an argument to the stream insertion or extraction operator overloads. For example, the output stream insertion operator has the following overload: std::ostream&amp; operator&lt;&lt; (std::ostream&amp; st, std::ostream&amp; (*func) (std::ostream&amp;)); The second argument is the function pointer, with the following signature: std::ostream&amp; (*func) (std::ostream&amp;) Any function that matches this signature can be used as a manipulator. For instance, the following user-defined manipulator does exactly the same job as the std::endl manipulator: std::ostream&amp; my_manipulator (std::ostream&amp; os) { return os &lt;&lt; '\n' &lt;&lt; std::flush; } Example usage: std::cout &lt;&lt; "Hello world!" &lt;&lt; my_manipulator; You can, of course, provide your own implementations to perform any type of manipulation. For example, suppose you want a manipulator that inserts an elipses into an output stream: std::ostream&amp; elipses (std::ostream&amp; os) { return os &lt;&lt; "..."; } Example usage: std::cout &lt;&lt; "Hello" &lt;&lt; elipses &lt;&lt; "world!" &lt;&lt; my_manipulator; Output: Hello...world!


Does printf() statement can generate only one line of output?

No, the printf() statement in C can generate multiple lines of output. You can include newline characters (\n) within the string to create line breaks, allowing for formatted output across multiple lines. Additionally, you can call printf() multiple times to print different lines.


What is the shortcut key for input statement in QBasic?

There is no shortcut key of input in qbasic


What are decision statements in java?

Decision statements are statements that are used for taking logical decisions. They contain a condition whose output is a boolean true or false. Ex: if (name.equals("Rock")) { System.out.println("Hi Rocky!!!"); } The output of the if condition will depend on the value that the variable name holds. This is a decision statement


What is the function of print statement?

The print statement in programming is used to output information to the console or standard output device. It displays specified values, variables, or messages, allowing developers to visualize data or debug code by checking the flow of execution and the state of variables at different points. By providing feedback to users or developers, the print statement is an essential tool for interaction and troubleshooting in code.

Related Questions

What are manipulatives?

manipulatives.anyofvariousobjectsormaterialsthatstudentscantouchandmovearoundinordertohelpthemlearnmathematicalandotherconcepts:theuseofblocks,flashcards,andothermanipulativesintheclassroom.


This manipulator is used to establish a field width for the value immediately following it?

The manipulator used to establish a field width for the value immediately following it is typically referred to as a field width specifier in formatting functions. In C++, for example, the setw manipulator from the &lt;iomanip&gt; library sets the width for the next output. This allows for better alignment of output in console applications by ensuring that numbers or strings occupy a specified number of characters, enhancing readability.


What is the output of the following print statement print(The path is Dsampletest.)What is the output of the following print statement print(The path is Dsampletest.)?

The output of the print statement print(The path is Dsampletest.) would result in a syntax error because the string is not enclosed in quotes. To correct it, the statement should be written as print(&quot;The path is Dsampletest.&quot;), which would then output: The path is Dsampletest.


What is a user defined manipulator in c plus plus?

A user-defined manipulator is a function which can be passed as an argument to the stream insertion or extraction operator overloads. For example, the output stream insertion operator has the following overload: std::ostream&amp; operator&lt;&lt; (std::ostream&amp; st, std::ostream&amp; (*func) (std::ostream&amp;)); The second argument is the function pointer, with the following signature: std::ostream&amp; (*func) (std::ostream&amp;) Any function that matches this signature can be used as a manipulator. For instance, the following user-defined manipulator does exactly the same job as the std::endl manipulator: std::ostream&amp; my_manipulator (std::ostream&amp; os) { return os &lt;&lt; '\n' &lt;&lt; std::flush; } Example usage: std::cout &lt;&lt; "Hello world!" &lt;&lt; my_manipulator; You can, of course, provide your own implementations to perform any type of manipulation. For example, suppose you want a manipulator that inserts an elipses into an output stream: std::ostream&amp; elipses (std::ostream&amp; os) { return os &lt;&lt; "..."; } Example usage: std::cout &lt;&lt; "Hello" &lt;&lt; elipses &lt;&lt; "world!" &lt;&lt; my_manipulator; Output: Hello...world!


Which manipulator is used to control the precision of floating point numbers?

In C and C++, the manipulator used to control the precision of floating point numbers is std::setprecision. This manipulator is part of the &lt;iomanip&gt; header and allows you to specify the number of digits to be displayed after the decimal point for floating-point output. For example, using std::cout &lt;&lt; std::setprecision(3) will format floating-point numbers to three decimal places.


Which statement is correct about cardiac output?

cardiac output is heart rate multiplied by stroke volume,


How do you initialize an output record in easytrieve?

In Easytrieve, you initialize an output record by defining the record structure in the DATA section and then using the WRITE statement to create a new record. You can set values for the fields of the record prior to the WRITE statement. For example, you might use the MOVE statement to assign values to specific fields before writing the output. Finally, the WRITE statement is executed to output the initialized record to the specified file or report.


How do you use irreducible in a sentence?

The output is a set of irreducible numerical semigroups containing it


What sentence has the word irreducible?

The output is a set of irreducible numerical semigroups containing it.


How do you create a program that will display output?

It must use a function with a "return" statement. Or you could output via console. (.NET CODE(C#)) Console.WriteLine("Output.");


What is the output if a cell containing a number 3245.45 is formatted to '?

what is the output if a cell containing number 3245.45 is formatted to '#,####'number format?


Cga provided four type of digital output?

That is not a question. It is a statement.