Setfill('*') Function in C++

The setfill function exist in iomanip library in C++ and it used to fill the padding which created through setw(3) function. The setfill function always used with setw(3) function and it take only one parameter (symbol) for filling.

Source Code

#include<iostream>
#include<iomanip>
using namespace std;
int main ()
{
 cout<<(" \t \t \t  LEP Tutorials\n \n \n");
 cout<< setfill('>')<<setw(20);
 cout<<("  1.C++ \n");
 cout<< setfill('>')<<setw(21);
 cout<<("  2.Java \n"); 
 cout<< setfill('>')<<setw(21);
 cout<<("  3.HTML \n");
 cout<< setfill('>')<<setw(20);
 cout<<("  4.CSS \n");
 cout<< setfill('>')<<setw(20);
 cout<<("  5.SEO \n");
}

Output of the Program

Setfill('*') Function in C++

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment