Thursday, 24 January 2013

program 2-6(51) Demonstrate fill by character

// Demonstrate fill character program.
#include <iostream>
#include <limits>
#include <iomanip>


using namespace std;

int main()
{
    // variables
    int num1 = 12345;
    int num2 = 54321;

    // process

    cout << setw(10)  << setfill('*') << num1 << "\t | setw 10 and it is fill with * \n";

    cout << setw(10) << num2 << "\t | setw 10 and it fill with just spaces \n";




   cin.ignore(numeric_limits<streamsize>::max(),'\n');
   cin.get();
    return 0;
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Enterprise Project Management