Saturday, 24 August 2013


C++ Program to Display Data Variable using setw Manipulator Function

Code:
/*C++ Program to Display Data Variable using setw Manipulator Function*/
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main(void)
{
 int a=100,b=200;
 clrscr();
 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

Related Posts :



0 comments:

Confused? Feel free to ask

Post a Comment