Setw(5) Function in C++

The Setw(5) exists in iomanip library and used to set the field width. Setw(5) set the number of characters to be used as the field width for the next insertion operation. In this problem we make the table of our website pages with setw(5) function.

Source Code

#include<iostream>
#include<iomanip>
using namespace std;
int main ()
{
 cout<<setw(45)<<"LEP Tutorials \n \n \n ";
 cout<<setw(5)<<"HOME"<<setw(10)<<"C++"<<setw(10)<<"JAVA"<<endl;
 cout<<setw(6)<<"HTML"<<setw(10)<<"CSS"<<setw(9)<<"PHP"<<endl;
 cout<<setw(9)<<"ANDROID"<<setw(9)<<"LINUX"<<setw(7)<<"SEO"<<endl;
}

Output of the Program

SETW(5) 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