width-function-in-C++ .

In this session i have discuss width function in C++ .

The width() function is used to define the width of field . It is a member function .

Width() syntax


Where w is number of columns .

Example : Write a program that demonstrate the width function .

    using namespace std;
    int main()
          return 0;
    OUTPUT : 456

The above program create the five columns and assign the value to right side to left side . It will left two columns from left side because there is only three digit value .

Welcome to AndroidATPoint.

back image                     next image