Write a C++ statement that uses the manipulator \'setfill\' to output a line con
ID: 3545724 • Letter: W
Question
Write a C++ statement that uses the manipulator 'setfill' to output a line containing 35 asterisk characters.
Here is the answer that I was given by a user on here
#include <iomanip>
cout<<setfill("*")<<setw(35)<<" ";
But I think it should be what I have below except my instructor says that I am missing something
#include <iomanip>
cout<<setfill("*")<<setw(35)<<"/n";
Why is it <<" "; and not <<"/n";
My instructor is saying that there is something missing between setw(35)<< and "
Explanation / Answer
" " is the new line character.
Maybe can try this:
cout << setfill('*') << setw(35) << "*" << " ";
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.