Program that explains the use of setfill manipulator.

Topic:

'setfill' Manipulator in C++ Manipulators

Problem:

Write a program that explains the use of setfill manipulator.

Solution:

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
int main ()
{
cout<<endl<<endl<<endl;
char str[]="result";
cout<<setw(15)<<setfill('*')<<str<<endl;
cout<<setw(15)<<setfill('@')<<str<<endl;
cout<<setw(15)<<setfill('=')<<str<<endl;
getch();
}

Output:


Let me know in the comment section if you have any question.

Previous Post:

Next Post: