Skip to content

C++ Program to Demonstrate setfill Manipulator

C++ Program to Demonstrate setfill Manipulator

Code:

/*C++ Program to Demonstrate setfill Manipulator*/
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main(void)
{
 int a=100,b=200;
 clrscr();
 cout<<setfill(‘*’);
 cout<<setw(5) << a <<setw(5) << b <<endl;
 cout<<setw(6) << a <<setw(6) << b <<endl;
 cout<<setw(7) << a <<setw(7) << b <<endl;
 getch();
}

Sample Output:

Comment bellow for your Query and Feedback

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!